/* 
 * Cabinet de Psychanalyse dans la région d'ajaccio - v1.1
 * Styles principaux selon la charte graphique v1.1
 * Date: 2 août 2025
 */

/* Variables CSS v1.1 - Mode sombre supporté */
:root {
    /* Espacement fluide */
    --space-fluid-xs: clamp(0.5rem, 1vw, 1rem);
    --space-fluid-sm: clamp(1rem, 2vw, 1.5rem);
    --space-fluid-md: clamp(1.5rem, 3vw, 2.5rem);
    --space-fluid-lg: clamp(2rem, 4vw, 4rem);
    --space-fluid-xl: clamp(3rem, 6vw, 6rem);
    
    /* Typographie fluide */
    --text-fluid-sm: clamp(0.875rem, 0.1vw + 0.8rem, 1rem);
    --text-fluid-base: clamp(1rem, 0.2vw + 0.9rem, 1.125rem);
    --text-fluid-lg: clamp(1.125rem, 0.3vw + 1rem, 1.25rem);
    --text-fluid-xl: clamp(1.25rem, 0.5vw + 1.1rem, 1.5rem);
    --text-fluid-2xl: clamp(1.5rem, 0.8vw + 1.2rem, 2rem);
    --text-fluid-3xl: clamp(1.875rem, 1.2vw + 1.4rem, 2.5rem);
    --text-fluid-4xl: clamp(2.25rem, 1.8vw + 1.5rem, 3.75rem);
    --text-fluid-5xl: clamp(2.75rem, 2vw + 2rem, 4.5rem);
}

/* Reset et base modernisés */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-display: swap;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter Variable', 'Inter', system-ui, sans-serif;
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typographie fluide v1.1 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Crimson Pro Variable', 'Crimson Pro', Georgia, serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem 0;
}

h1 { font-size: var(--text-fluid-5xl); }
h2 { font-size: var(--text-fluid-4xl); }
h3 { font-size: var(--text-fluid-3xl); }
h4 { font-size: var(--text-fluid-2xl); }
h5 { font-size: var(--text-fluid-xl); }
h6 { font-size: var(--text-fluid-lg); }

p, li {
    font-size: var(--text-fluid-base);
    margin: 0 0 1rem 0;
}

/* Navigation améliorée */
.nav-link {
    position: relative;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, rgb(var(--consciousness-400)), rgb(var(--transference-400)));
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Composants v1.1 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: var(--text-fluid-base);
}

.btn-primary {
    background: linear-gradient(135deg, rgb(var(--consciousness-600)) 0%, rgb(var(--consciousness-500)) 50%, rgb(var(--consciousness-400)) 100%);
    color: rgb(var(--mind-900));
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
}

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

/* Nouvelle couleur transference pour micro-interactions */
.btn-transference {
    background: linear-gradient(135deg, rgb(var(--transference-500)) 0%, rgb(var(--transference-600)) 100%);
    color: white;
    box-shadow: 0 20px 40px -12px rgba(244, 63, 94, 0.3);
}

.btn-transference:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 30px 50px -12px rgba(244, 63, 94, 0.4);
}

/* Cartes v1.1 */
.card {
    border-radius: 1rem;
    padding: var(--space-fluid-md);
    transition: all 0.5s ease;
}

.card-elevated {
    background: rgb(var(--mind-50));
    border: 1px solid rgb(var(--mind-200));
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

.card-glass {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(16px);
}

/* Formulaires v1.1 */
.form-field {
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: white;
    font-size: var(--text-fluid-base);
    transition: all 0.3s ease;
}

.form-field:focus {
    outline: none;
    border-color: rgb(var(--consciousness-400));
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.2);
}

.form-field::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

/* Animations v1.1 avec scroll-driven */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes fadeInView {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUpView {
    from {
        opacity: 0;
        transform: translateY(2rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Support des animations scroll-driven */
@supports (animation-timeline: view()) {
    .animate-on-scroll {
        animation: slideUpView linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 30%;
    }
}

/* Utilitaires de performance v1.1 */
.performance-optimized {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus visible pour l'accessibilité */
:focus-visible {
    outline: 2px solid rgb(var(--consciousness-400));
    outline-offset: 2px;
}

/* Container Queries v1.1 */
@container (min-width: 768px) {
    .container-responsive {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-fluid-lg);
    }
}

@container (min-width: 1024px) {
    .container-responsive {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Grilles fluides */
.grid-auto-fit {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--space-fluid-md);
}

/* Mode sombre spécifique */
[data-theme='dark'] .card-elevated {
    background: rgb(var(--mind-800));
    border-color: rgb(var(--mind-700));
}

[data-theme='dark'] .form-field {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme='dark'] .form-field:focus {
    background: rgba(0, 0, 0, 0.3);
}

/* Styles spécifiques pour la section calendrier */
#calendrier {
    position: relative;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 1rem;
    margin: 2rem 0;
    padding: 2rem 0;
}

#calendrier::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--consciousness-400), var(--transference-400));
    border-radius: 1rem 1rem 0 0;
}

#calendrier .container {
    position: relative;
    z-index: 1;
}

#calendrier h2 {
    text-align: center;
    color: var(--mind-800);
    margin-bottom: 0.5rem;
}

#calendrier .muted {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--mind-600);
}

/* Améliorations pour les boutons du calendrier */
.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 12px -1px rgba(37, 99, 235, 0.4);
    color: white;
}

/* Animation pour la section calendrier */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#calendrier {
    animation: slideInFromBottom 0.6s ease-out;
}

/* Styles spécifiques pour le formulaire de réservation */
#booking-form {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#booking-form.show {
    opacity: 1;
    transform: translateY(0);
}

.booking-step {
    transition: all 0.2s ease;
}

.booking-step:hover {
    transform: translateY(-1px);
}

/* Styles pour les champs de formulaire améliorés */
.booking-step input:focus,
.booking-step textarea:focus {
    outline: none;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    transform: translateY(-1px);
}

/* Animation pour le micro-rituel d'engagement */
.booking-step textarea[name="engagement"] {
    transition: all 0.3s ease;
    font-family: 'Georgia', serif;
    font-style: italic;
    line-height: 1.6;
}

.booking-step textarea[name="engagement"]:focus {
    background: #fffbeb !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1) !important;
}

/* Responsive pour la section calendrier */
@media (max-width: 768px) {
    #calendrier {
        margin: 1rem 0;
        padding: 1.5rem 0;
        border-radius: 0.5rem;
    }
    
    #calendrier h2 {
        font-size: 1.5rem;
    }
    
    #calendrier .muted {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    #booking-form {
        padding: 1.5rem !important;
    }
    
    .booking-step div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .booking-step div[style*="justify-content: space-between"] {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Print styles */
@media print {
    .theme-toggle,
    .btn,
    .particles-js {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    #calendrier {
        background: #fff;
        border: 1px solid #ccc;
    }
    
    #booking-form {
        background: #fff !important;
        border: 1px solid #ccc !important;
    }
}

/* Styles pour les messages flash */
.alert {
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
}

.alert-success {
    background-color: #dcfce7;
    border: 1px solid #16a34a;
    color: #15803d;
}

.alert-error {
    background-color: #fef2f2;
    border: 1px solid #ef4444;
    color: #dc2626;
}

.alert-info {
    background-color: #dbeafe;
    border: 1px solid #2563eb;
    color: #1d4ed8;
}

/* Mode sombre pour les alertes */
@media (prefers-color-scheme: dark) {
    .alert-success {
        background-color: rgba(22, 163, 74, 0.1);
        border-color: #16a34a;
        color: #4ade80;
    }
    
    .alert-error {
        background-color: rgba(239, 68, 68, 0.1);
        border-color: #ef4444;
        color: #f87171;
    }
    
    .alert-info {
        background-color: rgba(37, 99, 235, 0.1);
        border-color: #2563eb;
        color: #60a5fa;
    }
}