/* main.css - Styles de base pour toute l'application */

/* =================================
   VARIABLES CSS - SYSTÈME DE THÈMES
   ================================= */

:root {
    /* Couleurs principales */
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent-color: #a855f7;
    
    /* Mode sombre (par défaut) */
    --background: #0f0f23;
    --surface: #1a1a2e;
    --surface-hover: #16213e;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #2d3748;
    
    /* Sidebar sombre */
    --sidebar-bg: #0d1117;
    --sidebar-border: #21262d;
    --sidebar-hover: #21262d;
    --sidebar-active: #8b5cf6;
    --sidebar-text: #e2e8f0;
    --sidebar-text-secondary: #94a3b8;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.25);
}

/* Mode clair */
[data-theme="light"] {
    --background: #f8fafc;
    --surface: white;
    --surface-hover: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border: #e2e8f0;
    
    /* Sidebar en mode clair */
    --sidebar-bg: #1e1b4b;
    --sidebar-border: #312e81;
    --sidebar-hover: #312e81;
    --sidebar-active: #8b5cf6;
    --sidebar-text: white;
    --sidebar-text-secondary: #c7d2fe;
}

/* =================================
   RESET ET BASE
   ================================= */

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

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* =================================
   SCROLLBARS GLOBALES
   ================================= */

/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

::-webkit-scrollbar-corner {
    background: var(--surface);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--surface);
}

/* =================================
   STYLES POUR L'AUTHENTIFICATION
   ================================= */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-normal);
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.auth-title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* =================================
   FORMULAIRES
   ================================= */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: var(--surface-hover);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-input:invalid {
    border-color: #ef4444;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #22c55e;
}

/* =================================
   BOUTONS
   ================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(139, 92, 246, 0.05);
}

/* =================================
   ALERTES ET NOTIFICATIONS
   ================================= */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border-width: 1px;
    border-style: solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #16a34a;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #d97706;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #2563eb;
}

/* =================================
   NAVIGATION ET LIENS
   ================================= */

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.auth-switch a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* =================================
   UTILITAIRES
   ================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.mt-6 { margin-top: 1.5rem; }

/* =================================
   PRICING PAGE
   ================================= */

.pricing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.pricing-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    transition: all var(--transition-normal);
    overflow: hidden;
}

.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.pricing-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.pricing-card:hover::before {
    transform: scaleX(1);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured::before {
    transform: scaleX(1);
}

.pricing-card.current-plan {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.current-badge {
    background: #22c55e;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.plan-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1;
}

.plan-features {
    list-style: none;
    margin-bottom: 2rem;
}

.plan-features li {
    padding: 0.75rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.plan-features li::before {
    content: "✓";
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.125rem;
}

.plan-button {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.plan-button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.plan-button.secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.plan-button.secondary:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.billing-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-weight: 600;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--border);
    border-radius: 15px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.toggle-switch.active {
    background: var(--primary-color);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(30px);
}

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

@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .pricing-container {
        padding: 1rem;
    }
    
    .pricing-title {
        font-size: 2rem;
    }
    
    .pricing-plans {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pricing-card.featured {
        transform: none;
    }
    
    .plan-price {
        font-size: 2.5rem;
    }
    
    /* Scrollbars plus larges sur mobile */
    ::-webkit-scrollbar {
        width: 12px;
        height: 12px;
    }
}

@media (max-width: 480px) {
    .form-input,
    .btn {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    .billing-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* =================================
   AMÉLIORATIONS VISUELLES
   ================================= */

/* Focus visible pour l'accessibilité */
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Sélection de texte */
::selection {
    background: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}

/* Transition pour le changement de thème */
* {
    transition: background-color var(--transition-normal), 
                border-color var(--transition-normal), 
                color var(--transition-normal);
}

/* Préfère les animations réduites */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mode sombre préféré */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        /* Les variables sombres sont déjà définies par défaut */
    }
}

/* =================================
   PRINT STYLES
   ================================= */

@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .auth-container {
        background: white;
    }
    
    .btn,
    .pricing-card {
        border: 1px solid #ccc;
    }
}