/* album-public.css - Styles page album public FO */

/* ================================================
   COMPOSANTS — PANNEAU DÉTAILS & LIGHTBOX
   ================================================ */

/* Panneau de détails photo (style Google Photos) */
.photo-details-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.photo-details-panel.open {
    right: 0;
}

/* Lightbox info panel */
.lightbox-info-panel {
    position: absolute;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    z-index: 1002;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.lightbox-info-panel.open {
    right: 0;
}

.lightbox-info-header {
    padding: 0.3rem 1.5rem;
    border-bottom: 1px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--primary);
    z-index: 10;
}

.lightbox-info-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
    font-weight: bold;
    font-family: inherit;
}

.close-lightbox-info {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0.1rem;
}

.lightbox-info-content {
    padding: 0.75rem;
}

.lightbox-top-left {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
}

.lightbox-info-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
}

.lightbox-info-btn:hover,
.lightbox-download-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.lightbox-comment-badge {
    background: rgba(255, 255, 255, 0.92);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-comment-badge:hover {
    background: white;
}

.lightbox-rating-badge {
    color: #ffd700;
    font-size: 1rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.65);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-pill);
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-rating-badge:hover {
    background: rgba(0, 0, 0, 0.85);
}

.details-header {
    padding: 0.3rem 1.5rem;
    border-bottom: 1px solid var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--primary);
    z-index: 10;
}

.details-header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #fff;
    font-weight: bold;
    font-family: inherit;
}

.close-details-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #fff;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.close-details-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}
}

.close-details-btn:hover {
    color: var(--primary);
}

.details-content {
    padding: 0.6rem 0.75rem;
}

.detail-section {
    margin-bottom: 0.5rem;
}

.detail-section h4 {
    font-size: 0.88rem;
    color: #fff;
    margin: 0 -0.75rem 0.35rem -0.75rem;
    padding: 0.3rem 0.75rem;
    font-weight: 600;
    background: var(--primary-alt);
    text-transform: none;
    letter-spacing: 0;
    font-family: inherit;
}

.lightbox-info-panel .detail-section h4 {
    color: rgba(255, 255, 255, 0.7);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    border-bottom: 1px solid var(--border-lighter);
    font-size: 0.88rem;
}

.lightbox-info-panel .detail-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: normal;
}

.lightbox-info-panel .detail-label {
    color: rgba(255, 255, 255, 0.7);
}

.detail-value {
    color: var(--primary);
    font-weight: normal;
    font-size: 0.88rem;
    font-family: inherit;
    text-align: right;
    max-width: 60%;
    overflow-wrap: break-word;
}

.lightbox-info-panel .detail-value {
    color: white;
}

/* ================================================
   COMPOSANTS — BOUTONS D'ACTION PHOTOS
   ================================================ */

/* Nouveaux styles pour les boutons d'action sur les photos */
.photo-actions-top {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2;
}

.album-photo:hover .photo-actions-top {
    opacity: 1;
}

.photo-action-btn {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.photo-action-btn:hover,
.download-btn-bottom:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: scale(1.1);
}

.photo-action-btn svg {
    width: 20px;
    height: 20px;
}

/* Bouton de téléchargement en bas à gauche de la vignette */
.download-btn-bottom {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    opacity: 0;
    z-index: 2;
}

.album-photo:hover .download-btn-bottom {
    opacity: 1;
}

/* .download-btn-bottom:hover fusionné dans .photo-action-btn:hover ci-dessus */

/* Bouton de téléchargement dans la lightbox */
.lightbox-download-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1003;
    transition: background 0.3s;
    text-decoration: none;
}

/* .lightbox-download-btn:hover fusionné dans .lightbox-info-btn:hover ci-dessus */

/* Amélioration des capsules de photos */
.album-photo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    padding: 8px;
}

.album-photo:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.album-photo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
}

/* Responsive */
@media (max-width: 768px) {
    .photo-details-panel,
    .lightbox-info-panel {
        width: 100%;
        right: -100%;
    }
    
    .photo-actions-top,
    .download-btn-bottom {
        opacity: 1;
    }
    
    .lightbox-info-btn,
    .lightbox-download-btn {
        width: 45px;
        height: 45px;
    }
}

/* ================================================
   COMPOSANTS — NOTATION & AVIS
   ================================================ */

/* Section notation et commentaire */
/* Section notation première (sans bordure ni espacement) */
.rating-section-first {
    border-top: none;
    padding-top: 0 !important;
    margin-top: 0;
}

.rating-section {
    border-top: 2px solid var(--bg-blue-light);
    padding-top: 0.6rem !important;
    margin-top: 0.6rem;
}

.rating-container {
    margin-top: 0.5rem;
}

.stars-rating {
    display: flex;
    gap: 0.5rem;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.stars-rating .star {
    cursor: pointer;
    transition: all 0.2s;
    color: var(--border-light);
}

.stars-rating .star:hover,
.stars-rating .star.active {
    color: #ffd700;
    transform: scale(1.1);
}

.comment-container {
    margin: 0.5rem 0;
}

.comment-container textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.comment-container textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.rating-container .btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
}

/* Badges notation et commentaire sur miniatures FO */
.photo-rating-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 10;
    transition: transform 0.2s;
}

.photo-rating-badge:hover,
.photo-comment-badge:hover {
    transform: scale(1.1);
}

.photo-comment-badge {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.photo-comment-badge svg {
    color: var(--text-medium);
}

/* .photo-comment-badge:hover fusionné dans .photo-rating-badge:hover ci-dessus */

/* Réduction espacements panneau détails FO - Intégré ci-dessus */

/* Section avis sans bandeau foncé */
.rating-section-first h4 {
    background: none;
    color: var(--primary);
    margin: 0 0 0.4rem 0;
    padding: 0;
    font-size: 0.88rem;
    font-family: inherit;
}

/* Formulaire avis album */
.album-review-form {
    background: var(--bg-gray);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 2rem 0;
}

.album-review-form h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.review-stars {
    margin-bottom: 1.5rem;
}

.review-stars label,
.review-comment label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary);
}

.stars-input {
    display: flex;
    gap: 0.5rem;
    font-size: 2.5rem;
}

.review-star {
    cursor: pointer;
    color: var(--border-light);
    transition: all 0.2s;
}

.review-star:hover,
.review-star.active {
    color: #ffd700;
    transform: scale(1.1);
}

.review-comment {
    margin-bottom: 1.5rem;
}

/* .review-comment label fusionné dans .review-stars label ci-dessus */

.review-comment textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.review-comment textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.review-publication {
    margin-bottom: 1.5rem;
}

.review-publication label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.review-publication input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.review-actions {
    display: flex;
    gap: 1rem;
}

.album-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    position: relative;
}

.album-actions-center {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
}

.review-or {
    display: flex;
    align-items: center;
    color: var(--text-muted, #888);
    font-size: 0.9rem;
    font-style: italic;
}

.page-header {
    padding-bottom: 1.5rem;
}

.album-viewer {
    padding-top: 1.5rem;
    overflow-x: hidden;
}

/* Contrôles de vue (mode grille + filtres) :
   alignés à droite sur la même ligne que les actions, passage à la ligne si la place manque */
.album-view-controls {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.album-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 41px;
    height: 41px;
    border: 1px solid var(--border, #ddd);
    border-radius: var(--radius-sm, 4px);
    background: #fff;
    color: var(--text-muted, #888);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.album-view-btn:hover {
    background: #f0f0f0;
    color: var(--text, #333);
}

.album-view-btn.active {
    background: var(--primary, #3498db);
    border-color: var(--primary, #3498db);
    color: #fff;
}

.album-view-btn.filter-active {
    background: rgba(52, 152, 219, 0.1);
    border-color: var(--color-info, #3498db);
    color: var(--color-info, #3498db);
}

/* Mode tuiles dynamiques */
.album-grid.view-dynamic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: 8px;
    gap: 4px;
    padding: 0;
}

.album-grid.view-dynamic .album-photo {
    padding: 0;
    border-radius: 4px;
    box-shadow: none;
    background: transparent;
    transition: opacity 0.2s;
}

.album-grid.view-dynamic .album-photo:hover {
    transform: none;
    box-shadow: none;
    opacity: 0.9;
}

.album-grid.view-dynamic .album-photo img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.info-tile-content {
    font-weight: 600;
}

.album-grid.view-dynamic .info-tile {
    background: #f8f8f8;
    align-items: flex-start;
    padding: 0.75rem;
    height: auto;
}

.filter-count-bar {
    text-align: center;
    padding: 0.45rem 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-medium);
    font-size: 0.9rem;
    background: var(--bg-filter);
    border-radius: var(--radius-pill);
    font-weight: 500;
}

@media (max-width: 768px) {
    .album-actions {
        flex-direction: column;
        position: static;
    }

    .album-actions-center {
        flex-direction: column;
        flex: 0 0 auto;
        width: 100%;
    }

    .album-actions-center .btn {
        width: 100%;
    }

    .album-view-controls {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }

    .album-view-btn {
        flex: 1;
        height: 40px;
    }

@media (max-width: 480px) {
    #view-grid-btn,
    #view-dynamic-btn {
        display: none;
    }
}
}

/* Bouton slideshow : toujours visible */
#slideshow-btn {
    display: flex;
}

/* ================================================
   DIAPORAMA PLEIN ÉCRAN
   ================================================ */

.slideshow-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.slideshow-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.slideshow-counter {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.82rem;
    letter-spacing: 0.5px;
    z-index: 2;
}

.slideshow-controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    align-items: center;
    z-index: 2;
}

.slideshow-ctrl-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    color: rgba(255,255,255,0.85);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.slideshow-ctrl-btn:hover {
    background: rgba(255,255,255,0.25);
}

.slideshow-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255,255,255,0.15);
    z-index: 1;
}

.slideshow-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary, #c0392b);
    transition: width linear;
}

/* ================================================
   POPIN TÉLÉCHARGEMENT (choix qualité)
   ================================================ */

.download-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.download-modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.download-modal h3 {
    font-family: var(--font-body);
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.download-modal > p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.download-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.download-quality-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
    width: 100%;
}

.download-quality-btn:hover {
    background: var(--primary);
    color: white;
}

.dqb-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.dqb-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    flex: 1;
    text-align: left;
}

.dqb-desc {
    font-size: 0.75rem;
    opacity: 0.75;
    white-space: nowrap;
}

.download-modal-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}

.download-modal-close:hover {
    color: var(--primary);
}

@media (max-width: 480px) {
    .download-modal-buttons {
        flex-direction: column;
    }
}

/* ================================================
   POPIN FILTRE
   ================================================ */

.filter-modal-box {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.filter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.filter-modal-header h3 {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--primary);
    margin: 0;
}

.filter-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-placeholder);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.2s;
}

.filter-modal-close:hover { color: var(--primary); }

.filter-modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-stars-row {
    display: flex;
    gap: 0.3rem;
}

.fstar {
    font-size: 2rem;
    cursor: pointer;
    color: var(--border-light);
    transition: color 0.1s, transform 0.1s;
    user-select: none;
    line-height: 1;
}

.fstar.fstar-active { color: var(--accent); }
.fstar.fstar-hover  { color: var(--color-gold-hover); }
.fstar:hover        { transform: scale(1.15); }

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--text-dark);
}

.filter-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.filter-search-input {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.filter-search-input:focus { border-color: var(--primary); }

.filter-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

/* ================================================
   COMPOSANTS — BARRE D'INFO ALBUM
   ================================================ */

/* Album info bar - photo count and sync date */
.album-info-bar {
    background: white;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.album-info-bar p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

@media (max-width: 480px) {
    .filter-modal-actions {
        flex-direction: column;
    }
    .filter-modal-actions .btn {
        width: 100%;
        text-align: center;
    }
    .review-actions {
        flex-direction: column;
    }
    .review-actions .btn {
        width: 100%;
        text-align: center;
    }
}
