/**
 * Styles pour le Système de Favoris - CARRÉ PARFAIT SANS ARRONDI
 * Archives System
 */

/* ========================================
   BOUTON FAVORIS - CARRÉ PARFAIT
======================================== */

/* Tous les sélecteurs possibles pour être sûr */
.favorite-btn,
button.favorite-btn,
.card-favorite-btn .favorite-btn,
.archive-card .favorite-btn,
.archive-card-image .favorite-btn,
div .favorite-btn,
.favorite-btn.active,
.favorite-btn.login-required {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 5 !important;           /* AUCUN arrondi */
    -webkit-border-radius: 5 !important;   /* Safari */
    -moz-border-radius: 5 !important;      /* Firefox */
    width: 55px !important;
    height: 55px !important;
    min-width: 55px !important;
    min-height: 55px !important;
    max-width: 55px !important;
    max-height: 55px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
    z-index: 10 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
}

/* Hover state */
.favorite-btn:hover,
button.favorite-btn:hover,
.card-favorite-btn .favorite-btn:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    background: rgba(255, 255, 255, 1) !important;
    border-color: #cbd5e0 !important;
    border-radius: 5 !important;  /* Même au hover */
}

/* CŒUR UNICODE - TRÈS GRAND */
.favorite-btn .heart-unicode,
button.favorite-btn .heart-unicode,
.favorite-btn > .heart-unicode {
    font-size: 40px !important;
    line-height: 1 !important;
    color: #a0aec0 !important;
    transition: all 0.3s ease !important;
    display: block !important;
    font-family: Arial, sans-serif !important;
    font-weight: normal !important;
}

/* État normal - Cœur gris */
.favorite-btn .heart-unicode {
    color: #a0aec0 !important;
}

/* Hover - Cœur rose */
.favorite-btn:not(.active):hover .heart-unicode {
    color: #fc8181 !important;
    transform: scale(1.1) !important;
}

/* État actif - Cœur rouge */
.favorite-btn.active .heart-unicode {
    color: #e53e3e !important;
}

.favorite-btn.active {
    background: rgba(255, 255, 255, 1) !important;
    border-color: #e53e3e !important;
    animation: heartBeat 0.5s ease-in-out !important;
}

.favorite-btn:active {
    transform: scale(0.95) !important;
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    20% { transform: scale(1.25); }
    40% { transform: scale(0.95); }
    60% { transform: scale(1.15); }
    80% { transform: scale(1.05); }
}

.favorite-btn.login-required {
    opacity: 0.7 !important;
    cursor: not-allowed !important;
}

.favorite-btn.login-required:hover {
    transform: scale(1.05) !important;
}

/* ========================================
   BOUTON FAVORIS DANS LES CARDS
======================================== */

.card-favorite-btn {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 20 !important;
    pointer-events: auto !important;  /* Important pour que le clic marche */
}

.archive-card-image {
    position: relative !important;
}

.card-favorite-btn .favorite-btn {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(4px) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2) !important;
    pointer-events: auto !important;  /* Important pour que le clic marche */
}

.card-favorite-btn .favorite-btn:hover {
    background: rgba(255, 255, 255, 1) !important;
}

/* Empêcher le card de capturer le clic sur le bouton */
.archive-card {
    position: relative !important;
}

.archive-card-image .card-favorite-btn {
    pointer-events: auto !important;
}

/* ========================================
   BOUTON FAVORIS SUR LA PAGE SINGLE
======================================== */

.archive-favorite-action .favorite-btn {
    width: 65px !important;
    height: 65px !important;
    min-width: 65px !important;
    min-height: 65px !important;
    border-radius: 0 !important;
}

.archive-favorite-action .favorite-btn .heart-unicode {
    font-size: 45px !important;
}

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

@media (max-width: 480px) {
    .favorite-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        border-radius: 0 !important;
    }
    
    .favorite-btn .heart-unicode {
        font-size: 32px !important;
    }
    
    .card-favorite-btn .favorite-btn {
        width: 45px !important;
        height: 45px !important;
        min-width: 45px !important;
        min-height: 45px !important;
    }
    
    .card-favorite-btn .favorite-btn .heart-unicode {
        font-size: 28px !important;
    }
}

/* ========================================
   RESTE DU CSS (PROFIL, ETC.)
======================================== */

.archives-profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    background: #ffffff;
}

.profile-cover {
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    border-radius: 0;
}

.profile-avatar-wrapper {
    position: absolute;
    bottom: -75px;
    left: 50%;
    transform: translateX(-50%);
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid #ffffff;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.change-avatar-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.change-avatar-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.profile-info {
    text-align: center;
    padding: 90px 20px 30px;
}

.profile-name {
    font-size: 32px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 10px 0;
}

.profile-username {
    font-size: 18px;
    color: #667eea;
    margin: 0 0 10px 0;
}

.profile-email,
.profile-member-since {
    font-size: 14px;
    color: #718096;
    margin: 5px 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.stat-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.profile-tab {
    background: transparent;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s;
    position: relative;
}

.profile-tab:hover {
    background: #f7fafc;
    color: #667eea;
}

.profile-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.profile-tab-content {
    padding: 40px 20px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel h2 {
    font-size: 28px;
    color: #2d3748;
    margin-bottom: 30px;
    text-align: center;
}

.profile-favorites-grid,
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.favorite-card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    position: relative;
}

.favorite-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.favorite-card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.favorite-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.favorite-card:hover .favorite-card-image img {
    transform: scale(1.05);
}

.favorite-card-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 60px;
}

.remove-favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: #e53e3e;
    z-index: 10;
}

.remove-favorite-btn:hover {
    background: #e53e3e;
    color: white;
    transform: scale(1.1);
}

.favorite-card-content {
    padding: 20px;
}

.favorite-type {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.favorite-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin: 10px 0;
    line-height: 1.4;
}

.favorite-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.favorite-title a:hover {
    color: #667eea;
}

.favorite-author,
.favorite-year {
    font-size: 14px;
    color: #718096;
    margin: 5px 0;
}

.favorite-view-btn {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.favorite-view-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.submissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.submission-card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
}

.submission-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.submission-thumbnail {
    height: 180px;
    overflow: hidden;
}

.submission-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.submission-content {
    padding: 20px;
}

.submission-title {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.submission-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.submission-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-approved {
    background: #d1fae5;
    color: #065f46;
}

.status-rejected {
    background: #fee2e2;
    color: #7c2d12;
}

.status-draft {
    background: #e2e8f0;
    color: #2d3748;
}

.submission-date,
.submission-views {
    font-size: 13px;
    color: #718096;
}

.submission-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.submission-actions a {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.view-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.edit-link {
    background: #e2e8f0;
    color: #2d3748;
}

.view-link:hover,
.edit-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-section {
    background: #f7fafc;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.form-section h3 {
    font-size: 20px;
    color: #2d3748;
    margin: 0 0 20px 0;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

.save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h3 {
    font-size: 24px;
    color: #2d3748;
    margin: 20px 0 10px;
}

.empty-state p {
    color: #718096;
    font-size: 16px;
    margin-bottom: 30px;
}

.browse-btn,
.submit-btn {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.browse-btn:hover,
.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.no-favorites {
    text-align: center;
    padding: 60px 20px;
    background: #f7fafc;
    border-radius: 15px;
}

.no-favorites p {
    font-size: 18px;
    color: #718096;
    margin: 10px 0;
}

.profile-login-required,
.favorites-login-required {
    text-align: center;
    padding: 80px 20px;
}

.login-box {
    background: white;
    padding: 60px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 0 auto;
}

.login-box h2 {
    font-size: 28px;
    color: #2d3748;
    margin: 20px 0 10px;
}

.login-box p {
    color: #718096;
    margin-bottom: 30px;
}

.login-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

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

.favorite-card,
.submission-card {
    animation: fadeIn 0.4s ease-out;
}

.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: #718096;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #2d3748;
}

.upload-area {
    text-align: center;
    padding: 40px;
    border: 3px dashed #e2e8f0;
    border-radius: 15px;
    margin: 20px 0;
}

.select-file-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.select-file-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.upload-hint {
    color: #718096;
    font-size: 14px;
    margin-top: 10px;
}

#avatar-preview {
    text-align: center;
    margin-top: 20px;
}

#avatar-preview img {
    max-width: 200px;
    border-radius: 50%;
    margin-bottom: 20px;
}

.upload-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(72, 187, 120, 0.4);
}

@media (max-width: 768px) {
    .profile-cover {
        height: 200px;
    }
    
    .profile-avatar-wrapper {
        bottom: -60px;
    }
    
    .profile-avatar {
        width: 120px;
        height: 120px;
    }
    
    .profile-info {
        padding: 75px 20px 20px;
    }
    
    .profile-name {
        font-size: 24px;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .profile-tabs {
        flex-direction: column;
    }
    
    .profile-tab {
        width: 100%;
        text-align: center;
    }
    
    .profile-favorites-grid,
    .favorites-grid,
    .submissions-grid {
        grid-template-columns: 1fr;
    }
    
    .form-section {
        padding: 20px;
    }
}