/* ログページ専用スタイル */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #F8F5F0;
    color: #3A2A0A;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
.header {
    background: rgba(255, 140, 0, 0.9);
    color: white;
    padding: 20px 15px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.95;
    color: white;
    line-height: 1.6;
}

.header .subtitle br {
    display: block;
    margin: 4px 0;
}

/* 並び替えコントロール */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 800px;
    width: 100%;
    margin: 16px auto 0 auto;
    padding: 0 15px;
}

.sort-controls label {
    font-size: 14px;
    color: #3A2A0A;
    font-weight: 600;
}

.sort-dropdown {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sort-dropdown:hover {
    border-color: #FF8C00;
}

.sort-dropdown:focus {
    outline: none;
    border-color: #FF8C00;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.1);
}

/* コンテナ */
.container {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 15px;
}

/* ログコンテナ */
#logsContainer {
    width: 100%;
}

/* 月ヘッダー */
.month-group {
    margin-bottom: 30px;
}

.month-header {
    font-size: 20px;
    font-weight: bold;
    color: #7B4A12;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ff8c00;
}

/* 地域グループのスタイル */
.region-group {
    margin-bottom: 32px;
}

.region-header {
    font-size: 20px;
    font-weight: bold;
    color: #FF8C00;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #FF8C00;
}

/* ログカード */
.log-card {
    background: #FFFFFF;
    padding: 15px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.log-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* 編集アイコン */
.edit-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    padding: 8px;
    line-height: 1;
}

.edit-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.edit-icon:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
    border-radius: 4px;
}

.log-card h3 {
    font-size: 18px;
    color: #3A2A0A;
    margin-bottom: 8px;
}

.shop-link {
    color: #ff6b00;
    text-decoration: none;
    transition: color 0.2s;
}

.shop-link:hover {
    color: #ff8c00;
    text-decoration: underline;
}

.log-date {
    font-size: 14px;
    color: #7B4A12;
    margin-bottom: 5px;
}

.log-location {
    font-size: 14px;
    color: #7B4A12;
}

/* メニュー表示 */
.log-menu {
    font-size: 14px;
    color: #666;
    margin: 4px 0;
}

/* メモ表示 */
.log-memo {
    font-size: 14px;
    color: #888;
    font-style: italic;
    margin: 4px 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 22px;
    color: #3A2A0A;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 16px;
    color: #7B4A12;
    margin-bottom: 25px;
    line-height: 1.6;
}

.btn-back {
    display: inline-block;
    padding: 12px 30px;
    background: #ff6b00;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 16px;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #ff8c00;
}

/* フッター */
.footer {
    background: #3A2A0A;
    color: white;
    text-align: center;
    padding: 20px 15px;
    margin-top: auto;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content p {
    margin: 5px 0;
    font-size: 14px;
}

.footer-content a {
    color: #ff8c00;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* ハンバーガーメニュー */
.hamburger {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    transition: transform 0.3s ease;
}

.hamburger:hover {
    transform: scale(1.1);
}

.hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* メニューオーバーレイ */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* スライドメニュー */
.slide-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.slide-menu.active {
    right: 0;
}

.menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    font-size: 32px;
    color: #ff6b00;
    cursor: pointer;
    z-index: 1001;
}

.menu-list {
    list-style: none;
    padding: 60px 0 20px 0;
    margin: 0;
}

.menu-list li {
    margin: 0;
}

.menu-list a {
    display: block;
    padding: 18px 25px;
    color: #3A2A0A;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.2s ease, color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.menu-list a:hover {
    background-color: #fff5e6;
    color: #ff6b00;
}

/* 編集モーダル */
.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2001;
}

.modal-content {
    position: relative;
    z-index: 2002;
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #000;
}

.modal-close:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
    border-radius: 4px;
}

.modal-content h2 {
    margin: 0 0 24px 0;
    font-size: 24px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.form-group .readonly {
    margin: 0;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    color: #666;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.modal-actions button {
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f5f5f5;
    border: none;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-cancel:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

.btn-save {
    background: #ff6b35;
    border: none;
    color: white;
}

.btn-save:hover {
    background: #e55a2b;
}

.btn-save:focus {
    outline: 2px solid #ff6b35;
    outline-offset: 2px;
}

/* トースト通知 */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #4CAF50;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    font-size: 16px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========================================
   写真アップロード機能のスタイル
   ======================================== */

/* 写真アップロードエリア */
.photo-upload-area {
    margin-top: 12px;
}

.photo-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

/* 写真プレビューアイテム */
.photo-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #ddd;
    transition: border-color 0.2s;
}

.photo-preview-item:hover {
    border-color: #ff6b35;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}

.photo-preview-item img:hover {
    transform: scale(1.05);
}

/* 写真削除ボタン */
.photo-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.photo-delete-btn:hover {
    background: rgba(255, 0, 0, 1);
}

/* 写真追加ボタン */
.btn-add-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100px;
    height: 100px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    cursor: pointer;
    transition: all 0.2s;
    flex-direction: column;
    font-size: 14px;
    color: #666;
}

.btn-add-photo:hover {
    border-color: #ff6b35;
    background: #fff5f0;
    color: #ff6b35;
}

.btn-add-photo:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.add-photo-icon {
    font-size: 24px;
}

.add-photo-text {
    font-size: 12px;
}

/* ヘルプテキスト */
.photo-help-text {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* ログカード内の写真表示 */
.log-photos {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.log-photo-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #eee;
    cursor: pointer;
    transition: all 0.2s;
}

.log-photo-thumbnail:hover {
    border-color: #ff6b35;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 画像拡大モーダル */
.image-view-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3001;
}

.image-modal-content {
    position: relative;
    z-index: 3002;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

/* 画像モーダル閉じるボタン */
.image-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 3003;
}

.image-modal-close:hover {
    background: white;
    transform: scale(1.1);
}

/* 画像ナビゲーションボタン */
.image-nav-prev,
.image-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 3003;
}

.image-nav-prev {
    left: 20px;
}

.image-nav-next {
    right: 20px;
}

.image-nav-prev:hover,
.image-nav-next:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

/* 画像カウンター */
.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 3003;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .header h1 {
        font-size: 24px;
    }

    .month-header {
        font-size: 18px;
    }

    .log-card h3 {
        font-size: 16px;
    }

    .empty-icon {
        font-size: 48px;
    }

    .empty-state h2 {
        font-size: 20px;
    }

    .container {
        padding: 15px 10px;
    }

    .hamburger {
        top: 15px;
        right: 15px;
    }

    .modal-content {
        padding: 24px;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 20px;
    }

    /* 写真関連のレスポンシブ */
    .photo-preview-item,
    .btn-add-photo {
        width: 80px;
        height: 80px;
    }

    .log-photo-thumbnail {
        width: 60px;
        height: 60px;
    }

    .image-nav-prev,
    .image-nav-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .image-nav-prev {
        left: 10px;
    }

    .image-nav-next {
        right: 10px;
    }

    .image-modal-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}
