/**
 * Styles pour le système de favoris/sélections
 * PhotoClass Pro
 */

/* ========================================
   BOUTON FAVORIS SUR LES IMAGES
   ======================================== */

.photoclass-favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.photoclass-favorite-btn:hover {
    transform: scale(1.1);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.photoclass-favorite-btn svg {
    color: #e74c3c;
    transition: all 0.3s ease;
}

.photoclass-favorite-btn.is-favorite svg {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.photoclass-favorite-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   COMPTEUR DE FAVORIS (HEADER)
   ======================================== */

.photoclass-favorites-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    margin-top: 15px;
}

.photoclass-favorites-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.4);
    background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.photoclass-favorites-count {
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.photoclass-favorites-label {
    font-weight: 600;
}

/* ========================================
   PANNEAU DES FAVORIS
   ======================================== */

.photoclass-favorites-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photoclass-favorites-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.photoclass-favorites-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

/* Header du panneau */
.photoclass-favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

.photoclass-favorites-header h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.photoclass-favorites-header h2 svg {
    color: #e74c3c;
}

.photoclass-favorites-panel-count {
    color: #7f8c8d;
    font-weight: 400;
    font-size: 20px;
}

.photoclass-favorites-close {
    background: transparent;
    border: none;
    color: #95a5a6;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photoclass-favorites-close:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

/* Body du panneau */
.photoclass-favorites-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
}

.photoclass-favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.photoclass-no-favorites {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
    font-size: 16px;
}

/* Item favori */
.photoclass-favorite-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.photoclass-favorite-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photoclass-favorite-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 30px 10px 10px;
}

.photoclass-favorite-gallery {
    color: white;
    font-size: 13px;
    margin: 0;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.photoclass-favorite-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(231, 76, 60, 0.95);
    border: none;
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0;
}

.photoclass-favorite-item:hover .photoclass-favorite-remove {
    opacity: 1;
}

.photoclass-favorite-remove:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Footer du panneau */
.photoclass-favorites-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.photoclass-favorites-footer button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-secondary {
    background: white;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.button-secondary:hover {
    background: #e74c3c;
    color: white;
}

.button-primary {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.button-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(39, 174, 96, 0.4);
}

.button-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.photoclass-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    font-size: 15px;
    font-weight: 500;
    max-width: 350px;
}

.photoclass-notification.show {
    opacity: 1;
    transform: translateY(0);
}

.photoclass-notification-success {
    border-left: 4px solid #27ae60;
    color: #27ae60;
}

.photoclass-notification-error {
    border-left: 4px solid #e74c3c;
    color: #e74c3c;
}

.photoclass-notification-info {
    border-left: 4px solid #3498db;
    color: #3498db;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .photoclass-favorites-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 15px;
    }
    
    .photoclass-favorites-header,
    .photoclass-favorites-body,
    .photoclass-favorites-footer {
        padding: 15px 20px;
    }
    
    .photoclass-favorites-header h2 {
        font-size: 20px;
    }
    
    .photoclass-favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .photoclass-favorites-footer {
        flex-direction: column;
        gap: 10px;
    }
    
    .photoclass-favorites-footer button {
        width: 100%;
        justify-content: center;
    }
    
    .photoclass-notification {
        right: 20px;
        left: 20px;
        bottom: 20px;
    }
}

/* Empêcher le scroll du body quand le panneau est ouvert */
body.photoclass-favorites-open {
    overflow: hidden;
}

/* ========================================
   🆕 MESSAGE EXPLICATIF ROOM VIEW
   ======================================== */

.photoclass-roomview-info {
    padding: 20px 30px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.photoclass-roomview-info p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #2c3e50;
}

.photoclass-roomview-info strong {
    color: #27ae60;
}

/* ========================================
   🆕 BOUTON ROOM VIEW SUR CHAQUE PHOTO FAVORITE
   ======================================== */

.photoclass-favorite-roomview {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 115, 170, 0.95);
    border: none;
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.photoclass-favorite-roomview:hover {
    background: rgba(0, 90, 135, 1);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.5);
}

.photoclass-favorite-roomview svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .photoclass-roomview-info {
        padding: 15px 20px;
    }
    
    .photoclass-roomview-info p {
        font-size: 14px;
    }
    
    /* Sur mobile, toujours afficher le bouton Room View */
    .photoclass-favorite-roomview {
        opacity: 1;
        width: 32px;
        height: 32px;
    }
    
    .photoclass-favorite-roomview svg {
        width: 16px;
        height: 16px;
    }
}

/* Icône maison inline dans le texte */
.roomview-icon-inline {
    display: inline-block;
    vertical-align: middle;
    margin: 0 2px;
    background: rgba(0, 115, 170, 0.95);
    color: white;
    padding: 4px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.roomview-icon-inline path,
.roomview-icon-inline polyline {
    stroke: white;
}
