/* ==============================================
   イベントアルバム - ユーザー側CSS
   ============================================== */

/* ヘッダー */
.album-header {
    padding: 20px 16px 16px;
    text-align: center;
}
.album-back-link {
    display: inline-block;
    color: #0b5500;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 12px;
}
.album-back-link:hover {
    color: #0f766e;
}
.album-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
    line-height: 1.4;
}
.album-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 12px;
    line-height: 1.6;
}
.album-meta {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 16px;
}
.album-meta i {
    margin-right: 4px;
}

/* アルバムページでは友達にシェアボタンを非表示 */
.share-float-btn {
    display: none !important;
}

/* 選んで保存ボタン */
.album-select-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 28px;
    background: linear-gradient(135deg, #0b5500, #0f766e);
    color: #fff;
    border: none;
    border-radius: 28px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.3);
}
.album-select-toggle-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.4);
}
.album-select-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(13, 148, 136, 0.3);
}
.album-select-toggle-btn i {
    font-size: 1rem;
}
.album-select-toggle-btn.active {
    background: #fff;
    color: #0f766e;
    border: 2px solid #0b5500;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.15);
}
.album-select-toggle-btn.active:hover {
    background: #f0fdfa;
    box-shadow: 0 2px 12px rgba(13, 148, 136, 0.2);
}

/* 選択チェックマーク */
.album-item-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.85);
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-size: 0.6rem;
    transition: all 0.15s;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.album-item.selected .album-item-check {
    background: #0b5500;
    border-color: #fff;
    color: #fff;
    transform: scale(1.05);
}
/* 選択モード中のオーバーレイ */
.album-item.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 148, 136, 0.12);
    border: 2px solid rgba(13, 148, 136, 0.6);
    border-radius: inherit;
    pointer-events: none;
    z-index: 4;
}

/* 選択モード フッター（左：選択ツールバー／右：保存） */
.album-select-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    display: none;
    align-items: stretch;
    gap: 10px;
    background: #f9fafb;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(15, 118, 110, 0.12);
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.08);
}

.album-select-footer-toolbar {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 6px 6px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 2px 10px rgba(15, 23, 42, 0.04);
}

.album-footer-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 12px;
    background: #f3f4f6;
    color: #111827;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
}
.album-footer-close:hover {
    background: #e5e7eb;
    color: #030712;
}
.album-footer-close:active {
    transform: scale(0.94);
}

.album-footer-count {
    flex: 1;
    min-width: 0;
    color: #111827;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.album-footer-count-label {
    font-weight: 600;
    color: #374151;
    margin-left: 0.25em;
}

.album-footer-select-all {
    flex-shrink: 0;
    border: none;
    padding: 7px 12px;
    border-radius: 12px;
    background: #f3f4f6;
    color: #111827;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
}
.album-footer-select-all:hover {
    background: #e5e7eb;
    color: #030712;
}
.album-footer-select-all:active {
    transform: scale(0.96);
}

.album-select-footer-save {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border: none;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    background: linear-gradient(135deg, #0b5500, #0f766e);
    color: #fff;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.38);
}
.album-select-footer-save i {
    font-size: 0.88rem;
    opacity: 0.95;
}
.album-select-footer-save-text {
    white-space: nowrap;
}
.album-select-footer-save:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.album-select-footer-save:not(:disabled):hover {
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.45);
}
.album-select-footer-save:not(:disabled):active {
    transform: scale(0.97);
}

/* 保存中オーバーレイ */
.album-saving-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200000;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.album-saving-box {
    background: #fff;
    border-radius: 20px;
    padding: 28px 36px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}
.album-saving-box p {
    margin: 14px 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}
.album-saving-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e5e7eb;
    border-top-color: #0b5500;
    border-radius: 50%;
    margin: 0 auto;
    animation: album-spin 0.8s linear infinite;
}
@keyframes album-spin {
    to { transform: rotate(360deg); }
}

/* 選択モード中はグリッドの底パディング増やす（フッター分） */
.album-selecting .album-grid {
    padding-bottom: 132px;
}

/* 写真グリッド */
.album-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 0 4px 100px;
}
.album-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background: #f3f4f6;
    border-radius: 4px;
}
.album-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.album-item:hover .album-item-img {
    transform: scale(1.05);
}
.album-item-video {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f2937;
    color: #fff;
    font-size: 2.5rem;
}

/* 空状態 */
.album-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}
.album-empty i {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}
.album-empty p {
    font-size: 1rem;
}

/* ライトボックス */
.album-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.album-lightbox-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
}
.album-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.album-lightbox-prev,
.album-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.album-lightbox-prev { left: 12px; }
.album-lightbox-next { right: 12px; }
.album-lightbox-close:hover,
.album-lightbox-prev:hover,
.album-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.album-lightbox-content {
    position: relative;
    z-index: 5;
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.album-lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}
.album-lightbox-content video {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 4px;
}

.album-lightbox-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 16px 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 0.85rem;
}
#lightbox-caption {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#lightbox-counter {
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}
.album-lightbox-download {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}
.album-lightbox-download:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.3);
}

/* アルバムバッジ（イベント一覧で使用）— 虹色グラデーション */
.event-album-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: linear-gradient(
        90deg,
        #5eead4,
        #22d3ee,
        #3b82f6,
        #8b5cf6,
        #ec4899,
        #f97316,
        #5eead4
    );
    background-size: 200% 100%;
    animation: album-badge-rainbow 3s linear infinite;
    color: #fff;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    margin-top: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
@keyframes album-badge-rainbow {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.event-album-badge:hover {
    color: #fff;
    opacity: 0.9;
}

/* タブレット (3列) */
@media (min-width: 600px) {
    .album-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 0 8px 100px;
    }
    .album-title {
        font-size: 1.6rem;
    }
}

/* PC (4列) */
@media (min-width: 1025px) {
    .album-header {
        padding: 32px 20px 20px;
    }
    .album-title {
        font-size: 1.8rem;
    }
    .album-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 0 12px 60px;
    }
    .album-item {
        border-radius: 8px;
    }
    .album-lightbox-content {
        max-width: 80vw;
        max-height: 80vh;
    }
    .album-lightbox-content img {
        max-height: 80vh;
    }
    .album-lightbox-prev { left: 24px; }
    .album-lightbox-next { right: 24px; }
    .album-select-footer {
        left: 260px;
        padding-left: 16px;
        padding-right: 16px;
    }
}
@media (min-width: 1025px) and (max-width: 1279px) {
    .album-select-footer {
        left: 230px;
    }
}
