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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
}

/* Background refinements per page to better blend with fixed navbar (light) and dark footer */
.app-page-body {
    /* Soft colorful background with subtle light at top and gentle darkening toward footer */
    background:
        radial-gradient(1200px 1200px at 20% -10%, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0) 60%),
        radial-gradient(900px 900px at 85% 10%, rgba(254, 202, 87, 0.15), rgba(254, 202, 87, 0) 55%),
        linear-gradient(180deg, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.25) 100%),
        linear-gradient(135deg, #6a85ff 0%, #7f6bff 40%, #5e4fa2 100%);
    background-attachment: fixed, fixed, fixed, fixed;
}

.profile-page-body {
    /* Use the same background as app for consistent look */
    background:
        radial-gradient(1200px 1200px at 20% -10%, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0) 60%),
        radial-gradient(900px 900px at 85% 10%, rgba(254, 202, 87, 0.15), rgba(254, 202, 87, 0) 55%),
        linear-gradient(180deg, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.25) 100%),
        linear-gradient(135deg, #6a85ff 0%, #7f6bff 40%, #5e4fa2 100%);
    background-attachment: fixed, fixed, fixed, fixed;
}

/* Top navbar reused from landing */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 1rem 0;
    overflow: visible; /* ensure dropdowns are not clipped */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    text-decoration: none; /* prevent underline when used as <a> */
}

.nav-logo:hover { text-decoration: none; }

.logo-icon { font-size: 2rem; }

.nav-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    overflow: visible; /* allow dropdown to overflow */
}
/* Desktop: place language selector after action buttons (to the right) */
.nav-actions .btn { order: 1; }
.nav-actions .language-selector { order: 3; }

/* Center action buttons text/content */
.nav-actions .btn {
    justify-content: center;
    text-align: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Burger button */
.burger-btn {
    display: none;
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    cursor: pointer;
    z-index: 1300;
}
.burger-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #333;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .burger-btn { display: inline-flex; }
    .nav-right { gap: 8px; justify-content: flex-end; }
    /* Language selector goes inside dropdown on mobile */
    .nav-right .language-selector { display: none; }
    .language-btn { padding: 8px 12px; min-width: 70px; height: 36px; font-size: 14px; }
    .flag-icon { width: 20px; height: 20px; font-size: 18px; }
    .nav-actions {
        position: absolute;
        top: 100%;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid rgba(0,0,0,0.08);
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        display: none;
        flex-direction: column;
        padding: 10px;
        margin-top: 8px;
        gap: 10px;
        z-index: 1100;
        min-width: 220px;
    }
    .nav-actions.show { display: flex; align-items: stretch; }
    /* Mobile: language selector first, full width */
    .nav-actions .language-selector { display: flex; justify-content: center; width: 100%; order: 1; }
    .nav-actions .btn { width: 100%; }
    .nav-container { position: relative; }
}

.app-page-body .container,
.profile-page-body .container {
    padding-top: 120px; /* space for navbar */
}

.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Conteneur élargi pour la page de profil */
.profile-page-body .container {
    max-width: 1000px;
}

/* =========================
   SÉLECTEUR DE LANGUE
   ========================= */
.language-selector {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
}
/* Reset positioning when inside navbar */
.navbar .language-selector { position: relative; top: auto; right: auto; z-index: auto; }
.navbar .language-dropdown { right: 0; left: auto; }

.language-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 8px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    color: white;
    font-size: 14px;
    font-weight: 500;
    min-width: 70px;
    justify-content: center;
    height: 36px;
}

/* Make language code (FR/EN/ES) black inside the button */
.language-btn #currentLangCode {
    color: #000;
    font-weight: 600;
}

.language-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
}

.flag-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

/* Ensure flags are centered in dropdown options as well */
.language-dropdown .language-option .flag-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
}

.language-dropdown {
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    margin-top: 5px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px) !important;
    border-radius: 12px !important;
    padding: 8px 0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
    min-width: 120px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s ease !important;
    z-index: 99999 !important; /* Very high z-index to ensure visibility */
    display: block !important;
    pointer-events: none !important;
}


.language-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #333;
    font-size: 14px;
}

.language-option:hover {
    background: rgba(102, 126, 234, 0.1);
}

.language-option.active {
    background: rgba(102, 126, 234, 0.2);
    font-weight: 600;
}

/* =========================
   HEADER
   ========================= */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding-top: 60px; /* Espace pour le sélecteur de langue */
    position: relative;
}

.logo {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.subtitle {
    font-size: 16px;
    opacity: 0.8;
    font-weight: 300;
    text-align: center;
}

/* =========================
   CONTENU PRINCIPAL
   ========================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.record-section {
    text-align: center;
    margin-bottom: 40px;
}

.record-button {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 20px 40px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.record-button:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 50px rgba(255, 107, 107, 0.4);
}

.record-button.recording {
    animation: pulse 1.5s infinite;
    background: linear-gradient(135deg, #ff4757, #ff3742);
}

.record-button.analyzing {
    background: linear-gradient(135deg, #feca57, #ff9ff3);
    animation: spin 2s linear infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.record-icon {
    font-size: 60px;
    color: white;
}

.record-text {
    font-size: 18px;
    font-weight: 500;
    opacity: 0.9;
}

/* =========================
   UPLOAD
   ========================= */
.upload-section {
    margin-bottom: 30px;
}

.upload-button {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 10px;
    opacity: 0.7;
}

.upload-text {
    font-size: 16px;
    opacity: 0.8;
}

/* =========================
   RÉSULTATS
   ========================= */
.result-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease;
}

.result-card.show {
    transform: translateY(0);
    opacity: 1;
}

/* =========================
   TOP 3 RÉSULTATS
   ========================= */
.top-results {
    margin-bottom: 20px;
}

.top-results-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #feca57;
    text-align: center;
}

.top-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.result-item.most-likely {
    background: linear-gradient(135deg, rgba(254, 202, 87, 0.2), rgba(255, 193, 7, 0.15));
    border-color: rgba(254, 202, 87, 0.4);
    box-shadow: 0 4px 15px rgba(254, 202, 87, 0.2);
}

.result-item.second-likely {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.1));
    border-color: rgba(102, 126, 234, 0.3);
}

.result-item.third-likely {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.2);
}

.result-rank {
    position: absolute;
    top: 8px;
    left: 12px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    font-size: 14px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 50%;
    min-width: 24px;
    min-height: 24px;
    text-align: center;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.result-item.most-likely .result-rank {
    background: linear-gradient(45deg, #feca57, #ff9f43);
    color: #333;
    font-weight: 700;
}

.result-item.second-likely .result-rank {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.result-item.third-likely .result-rank {
    background: rgba(255, 255, 255, 0.3);
}

.result-type {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: white;
    margin-top: 8px;
    margin-left: 50px;
    margin-right: 50px;
    text-align: center;
}

.result-item.most-likely .result-type {
    color: #feca57;
    font-size: 18px;
}

.result-confidence {
    font-size: 14px;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 50px;
    margin-right: 50px;
    text-align: center;
}

.result-item.most-likely .result-confidence {
    color: rgba(254, 202, 87, 0.9);
    font-weight: 500;
}

.recommendations {
    margin-top: 20px;
    text-align: left;
}

.recommendations h4 {
    font-size: 16px;
    margin-bottom: 10px;
    color: #feca57;
}

.recommendations ul {
    list-style: none;
}

.recommendations li {
    padding: 5px 0;
    font-size: 14px;
    opacity: 0.9;
}

.recommendations li:before {
    content: "💡 ";
    margin-right: 8px;
}

/* =========================
   LOADING ET ERREURS
   ========================= */
.loading {
    display: none;
    text-align: center;
    margin: 20px 0;
}

.loading.show {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

.error-message {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* =========================
   DISCLAIMER ET CONTACT
   ========================= */
.disclaimer {
    margin-top: auto;
    padding: 20px 15px;
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

.disclaimer-text {
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.disclaimer-emphasis {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.ai-badge::before {
    content: "🤖";
    margin-right: 4px;
}

/* Contact du créateur */
.creator-contact {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-link:hover {
    color: #feca57;
    background: rgba(254, 202, 87, 0.1);
    border-color: rgba(254, 202, 87, 0.2);
    transform: translateY(-1px);
}

.contact-icon {
    font-size: 14px;
}

/* =========================
   MODALS
   ========================= */

.modal-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
    text-align: center;
}

.modal-text {
    color: #666;
    margin-bottom: 20px;
    text-align: center;
}

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

/* Contact Modal Header Styles */
#contactModal .modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid #eee !important;
}

#contactModal .modal-header h3 {
    text-align: center !important;
    color: #667eea !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

#contactModal .modal-close {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: none !important;
    border: none !important;
    font-size: 24px !important;
    color: #999 !important;
    cursor: pointer !important;
    padding: 5px !important;
    border-radius: 50% !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

#contactModal .modal-close:hover {
    color: #333 !important;
    background: rgba(0, 0, 0, 0.1) !important;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(102, 126, 234, 0.08);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.contact-item:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.contact-item .contact-icon {
    font-size: 18px;
    min-width: 20px;
}

.contact-item .contact-text {
    font-weight: 500;
    font-size: 14px;
    text-align: left;
}

/* =========================
   SYSTÈME DE FEEDBACK
   ========================= */
.feedback-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feedback-section h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #feca57;
    text-align: center;
}

.feedback-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.feedback-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.feedback-btn.correct {
    background: rgba(76, 175, 80, 0.8);
    color: white;
}

.feedback-btn.correct:hover {
    background: rgba(76, 175, 80, 1);
    transform: scale(1.05);
}

.feedback-btn.incorrect {
    background: rgba(244, 67, 54, 0.8);
    color: white;
}

.feedback-btn.incorrect:hover {
    background: rgba(244, 67, 54, 1);
    transform: scale(1.05);
}

.feedback-details {
    text-align: center;
}

.feedback-details label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
}

.feedback-details select {
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-bottom: 10px;
    width: 200px;
}

.feedback-details select option {
    background: #333;
    color: white;
}

.submit-correction {
    padding: 8px 16px;
    background: rgba(255, 193, 7, 0.8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.submit-correction:hover {
    background: rgba(255, 193, 7, 1);
}

.feedback-thanks {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   ANIMATIONS
   ========================= */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

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

/* Animation pour le changement de langue */
.language-transition {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.language-transition.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* =========================
   RESPONSIVE MOBILE
   ========================= */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .language-selector {
        top: 10px;
        right: 10px;
    }
    
    .language-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .language-dropdown {
        min-width: 100px;
    }
    
    .header {
        padding-top: 50px;
    }
    
    .record-button {
        width: 160px;
        height: 160px;
    }
    
    .record-icon {
        font-size: 50px;
    }
    
    .disclaimer {
        padding: 15px 10px;
    }

    .disclaimer-text {
        font-size: 11px;
    }

    .disclaimer-emphasis {
        font-size: 10px;
    }
}

/* =========================
   PAGE DE PROFIL
   ========================= */
.profile-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.profile-section,
.history-section,
.subscription-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.profile-section h2,
.history-section h2,
.subscription-section h2 {
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-section h2 i,
.history-section h2 i,
.subscription-section h2 i {
    color: #4CAF50;
    font-size: 1.5rem;
}

.profile-card,
.history-card,
.subscription-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-info {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-field label {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-field input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px 15px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.profile-field input:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.profile-field input[readonly] {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    cursor: not-allowed;
}

.plan-display {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.profile-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.history-limit {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.15));
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.history-limit i {
    color: #FFC107;
    font-size: 1.8rem;
    margin-bottom: 15px;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.history-limit span {
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.history-upgrade {
    text-align: center;
}

.current-plan h3,
.available-plans h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-align: center;
}

.plan-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.plan-card.current {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.plan-card.premium {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

.plan-name {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.plan-price {
    color: #4CAF50;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.plan-card.premium .plan-price {
    color: #FFD700;
}

.plan-features {
    margin-bottom: 25px;
}

.feature {
    color: #fff;
    padding: 8px 0;
    font-size: 0.9rem;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

/* =========================
   MENU UTILISATEUR
   ========================= */
.user-menu {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1000;
    margin-left: 0;
    display: flex;
    align-items: center;
    visibility: visible;
    opacity: 1;
    gap: 10px;
}

/* Ensure in-page back button is visible on profile page under fixed navbar */
.profile-page-body .user-menu {
    position: relative;
    top: 0;
    left: 0;
    z-index: 1;
    margin: 0 0 10px 0;
    align-self: flex-start;
}

.user-dropdown-container {
    position: relative;
}

.back-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 16px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* Make back button visible on white navbar */
.navbar .back-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #333;
}

.navbar .back-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.user-btn {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    min-width: 120px;
    justify-content: center;
}

.user-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.user-btn i {
    font-size: 16px;
}

.user-arrow {
    font-size: 12px !important;
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.user-btn:hover .user-arrow {
    transform: translateY(1px);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 250px;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    margin-top: 8px;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 16px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.user-email {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.user-plan {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

.user-actions {
    padding: 8px 0;
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #333;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 8px 0;
}

/* =========================
   MODALS
   ========================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    color: #111; /* ensure modal text is dark */
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}


.modal-body {
    padding: 24px;
}

/* Form styles for modals */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.recaptcha-container { display: flex; justify-content: center; }

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label .checkmark {
    display: none;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.modal-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

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

/* Button styles for modals */
.modal-body .btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Centrage spécifique pour les boutons de modal */
.modal-body form .btn {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-body .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.modal-body .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* =========================
   PROFIL
   ========================= */
.profile-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-field label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.profile-field input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.profile-field input:focus {
    outline: none;
    border-color: #667eea;
}

.profile-field input[readonly] {
    background: #f8f9fa;
    color: #666;
}

.plan-display {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 500;
    color: #333;
}

.profile-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
}


.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}


/* =========================
   HISTORIQUE
   ========================= */
.history-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.history-info {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.history-limit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 152, 0, 0.15));
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    padding: 20px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.history-upgrade {
    display: flex;
    justify-content: center;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    padding: 20px;
    background: linear-gradient(135deg, #f1f3f4 0%, #e8eaed 100%);
    border-radius: 12px;
    border-left: 4px solid #667eea;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.history-item-date {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.history-item-type {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
}

.history-item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-result {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

.delete-analysis-btn {
    background: #ef4444;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
}

.delete-analysis-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* =========================
   SIDEBAR HISTORIQUE
   ========================= */
.history-sidebar {
    position: fixed;
    top: 80px; /* Commence sous la navbar */
    left: -350px;
    width: 350px;
    height: calc(100vh - 80px); /* Prend toute la hauteur restante */
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-right: 1px solid #e5e7eb;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.history-sidebar.open {
    left: 0;
}

.history-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #667eea;
    color: white;
}

.history-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.history-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.history-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-sidebar-content {
    padding: 20px;
}

.history-loading {
    text-align: center;
    color: #666;
    padding: 20px;
}

.history-toggle-btn {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-toggle-btn:hover {
    background: #5a67d8;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.history-toggle-btn.hidden {
    display: none;
}

/* Overlay pour fermer la sidebar */
.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.history-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Items d'historique dans la sidebar */
.history-sidebar-item {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.history-sidebar-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.history-sidebar-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-sidebar-item-date {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.history-sidebar-item-confidence {
    font-size: 12px;
    font-weight: 600;
}

.history-sidebar-item-result {
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
}

.history-sidebar-item-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.history-sidebar-item-delete {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.history-sidebar-item-delete:hover {
    background: #dc2626;
    transform: scale(1.05);
}

.history-empty {
    text-align: center;
    color: #666;
    padding: 40px 20px;
}

.history-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.history-empty-text {
    font-size: 16px;
    margin-bottom: 8px;
}

.history-empty-subtext {
    font-size: 14px;
    color: #999;
}

/* =========================
   ABONNEMENT
   ========================= */
.subscription-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.current-plan h3,
.available-plans h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.plan-card {
    padding: 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.plan-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

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

.plan-card.premium {
    border-color: #f39c12;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

.plan-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.plan-price {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.plan-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.feature {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.plan-card button {
    width: 100%;
}

.plan-card button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================
   STATUT D'ABONNEMENT
   ========================= */
.plan-status {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.status-info {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.status-info.cancelling {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

.status-info.cancelled {
    background: rgba(220, 53, 69, 0.2);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.status-info.active {
    background: rgba(40, 167, 69, 0.2);
    border: 1px solid rgba(40, 167, 69, 0.3);
    color: #28a745;
}

.plan-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.plan-actions .btn {
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 160px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.plan-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.plan-actions .btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.btn-warning {
    background: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    border-color: #d39e00;
}

/* =========================
   MODALE DE CONFIRMATION
   ========================= */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(5px);
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.modal-overlay.show {
    display: flex !important;
}

/* Removed conflicting modal styles that were forcing visibility */

/* Removed conflicting modal styles that were forcing visibility */

/* Removed conflicting modal styles that were forcing visibility */

/* FORCE OVERRIDE - Styles spécifiques pour les boutons de sélection de plan */
body .plan-card button#upgradeBtn {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

body .plan-card button#upgradeBtn:hover:not(:disabled) {
    background: #007bff !important;
    background-color: #007bff !important;
    background-image: none !important;
    border-color: #007bff !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3) !important;
}

body .plan-card button#upgradeBtn.btn-outline {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

body .plan-card button#upgradeBtn.btn-outline:hover:not(:disabled) {
    background: #6c757d !important;
    background-color: #6c757d !important;
    background-image: none !important;
    border-color: #6c757d !important;
    color: white !important;
    box-shadow: none !important;
}

body .plan-card button#upgradeBtn:disabled {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    opacity: 0.6;
    box-shadow: none !important;
}

/* FORCE OVERRIDE - Styles pour les boutons de plan gratuit */
body .plan-card[data-plan="free"] button {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 2px solid #6c757d !important;
    color: #6c757d !important;
    font-weight: 600 !important;
    box-shadow: none !important;
}

body .plan-card[data-plan="free"] button.btn-primary {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 2px solid #007bff !important;
    color: #007bff !important;
    box-shadow: none !important;
}

body .plan-card[data-plan="free"] button.btn-primary:hover:not(:disabled) {
    background: #007bff !important;
    background-color: #007bff !important;
    background-image: none !important;
    border-color: #007bff !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3) !important;
}

/* =========================
   RESPONSIVE
   ========================= */
@media (max-width: 768px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
}

/* =========================
   FOOTER (depuis landing.css)
   ========================= */
.footer {
    background: #333;
    color: white;
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand p {
    color: #ccc;
    margin-top: 1rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-column h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-column a {
    display: block;
    color: #ccc;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 2rem;
    text-align: center;
    color: #ccc;
}

/* Avoid extra space after footer on profile page */
.profile-page-body #profileFooter + * { display: initial; }

/* Footer container must not inherit app/profile container sizing */
.footer > .container,
.footer > .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    min-height: 0;
    display: block;
}

/* Reduce overall vertical footprint */
.footer {
    padding: 32px 0 16px;
}
.footer-content {
    gap: 2rem;
    margin-bottom: 1rem;
}
.footer-column a { margin-bottom: 0.4rem; }
.footer-bottom { padding-top: 1rem; }

/* Full-bleed footer on profile page */
.profile-page-body .footer > .footer-container {
    max-width: 1200px; /* align with app footer */
    width: 100%;
    padding: 0 20px; /* same side padding as app */
}

/* Remove any residual bottom spacing on profile page */
.profile-page-body .footer { margin-bottom: 0; }
.profile-page-body { overflow-x: hidden; }

/* Stick footer to bottom on profile page */
.profile-page-body {
    min-height: 100vh;
    min-height: 100dvh; /* ensure mobile viewport height correctness */
    display: flex;
    flex-direction: column;
    position: relative;
}

.profile-page-body > .container {
    flex: 1 0 auto;
    min-height: 0; /* override global 100vh to allow footer to sit at bottom */
}

/* Footer remains static; flex layout keeps it at bottom without extra gap */
.profile-page-body .footer {
    margin-top: auto;
    flex-shrink: 0;
}

/* Full-bleed background and no side/bottom gaps on profile footer */
.profile-page-body .footer {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 0 !important;
    margin-top: auto;
    flex-shrink: 0;
}

/* Keep internal spacing but remove only bottom margin from footer itself */
.profile-page-body .footer {
    margin-bottom: 0 !important;
}

/* Ensure the main container doesn't force extra height under the footer */
.profile-page-body > .container {
    min-height: 0;
}

/* Responsive: avoid footer overlapping content on small screens */
@media (max-width: 768px) {
    .profile-page-body .footer { margin-top: auto; }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-links {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Force language dropdown to be visible when show class is present */
.language-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
    display: block !important;
}

