/* ŒnoT - CSS Responsive Commun
 * Styles responsives partagés pour toutes les pages web
 * Optimisé pour mobile et desktop
 */

/* =======================
   VARIABLES CSS COMMUNES
   ======================= */
:root {
    /* Couleurs inspirées du site principal ŒnoT */
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-dark: #5b21b6;
    --secondary: #f59e0b;
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Couleurs neutres très douces */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Couleurs de texte */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;
    
    /* Couleurs de bordure */
    --border-light: #f3f4f6;
    --border-medium: #e5e7eb;
    --border-dark: #d1d5db;
    
    /* Ombres très douces style ŒnoT */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Rayons de bordure plus doux */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
    
    /* Espacements compacts */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
    --space-3xl: 48px;
    --space-4xl: 64px;
    
    /* Breakpoints */
    --breakpoint-xs: 360px;
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1200px;
    --breakpoint-2xl: 1400px;
    
    /* Tailles tactiles */
    --touch-target-min: 44px;
    --touch-target-optimal: 48px;
    --touch-target-large: 52px;
}

/* =======================
   RESET ET BASE
   ======================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    overflow-x: hidden;
}

/* =======================
   LAYOUT RESPONSIVE
   ======================= */
.container {
    max-width: var(--breakpoint-xl);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    width: 100%;
}

.container-fluid {
    width: 100%;
    padding: 0 var(--space-lg);
}

/* =======================
   NAVIGATION RESPONSIVE
   ======================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: var(--space-lg);
    transition: height 0.3s ease;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: var(--touch-target-min);
    touch-action: manipulation;
}

.nav a:hover {
    color: var(--primary);
    background: rgba(124, 58, 237, 0.08);
    transform: translateY(-1px);
}

.nav a.active {
    color: var(--primary);
    background: rgba(124, 58, 237, 0.1);
}

/* =======================
   BOUTONS RESPONSIVE
   ======================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    border-radius: var(--radius-lg);
    padding: var(--space-md) var(--space-xl);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-height: var(--touch-target-optimal);
    touch-action: manipulation;
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
}

.btn-ghost:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
}

/* =======================
   GRILLES RESPONSIVE
   ======================= */
.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* =======================
   CARTES RESPONSIVE
   ======================= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* Extra Large Desktop: 1400px+ */
@media (min-width: 1400px) {
    .container {
        max-width: var(--breakpoint-2xl);
    }
}

/* Large Desktop: 1200px - 1399px */
@media (max-width: 1399px) {
    .container {
        max-width: var(--breakpoint-xl);
    }
}

/* Desktop: 1024px - 1199px */
@media (max-width: 1199px) {
    .container {
        padding: 0 var(--space-lg);
    }
    
    .grid-auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Tablet: 768px - 1023px */
@media (max-width: 1023px) {
    .header-inner {
        height: 60px;
    }
    
    .nav {
        gap: var(--space-md);
    }
    
    .nav a {
        padding: var(--space-sm) var(--space-md);
        font-size: 14px;
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-auto-fit {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Mobile Large: 640px - 767px */
@media (max-width: 767px) {
    .container {
        padding: 0 var(--space-md);
    }
    
    .header-inner {
        height: 56px;
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm) 0;
    }
    
    .nav {
        width: 100%;
        justify-content: space-between;
        gap: var(--space-xs);
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav a {
        font-size: 12px;
        padding: var(--space-xs) var(--space-sm);
        min-width: 80px;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-auto-fit,
    .grid-auto-fill {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .card {
        padding: var(--space-xl);
    }
}

/* Mobile Medium: 480px - 639px */
@media (max-width: 639px) {
    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }
    
    .grid-auto-fit,
    .grid-auto-fill {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--space-sm);
    }
}

/* Mobile Small: 360px - 479px */
@media (max-width: 479px) {
    .container {
        padding: 0 var(--space-sm);
    }
    
    .header-inner {
        gap: var(--space-xs);
        height: 52px;
    }
    
    .nav a {
        font-size: 10px;
        padding: var(--space-xs);
        min-width: 60px;
        text-align: center;
    }
    
    .nav a span {
        display: none;
    }
    
    .nav a svg {
        width: 20px;
        height: 20px;
        margin: 0 auto;
    }
    
    .grid-cols-4,
    .grid-cols-3,
    .grid-cols-2 {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .card {
        padding: var(--space-lg);
    }
}

/* Mobile Extra Small: 0px - 359px */
@media (max-width: 359px) {
    .nav a {
        min-width: 50px;
        padding: var(--space-xs) 2px;
    }
    
    .card {
        padding: var(--space-md);
    }
}

/* =======================
   AMÉLIORATIONS TACTILES
   ======================= */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: var(--touch-target-optimal);
        transition: transform 0.1s ease;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    .nav a {
        min-height: var(--touch-target-optimal);
        min-width: var(--touch-target-optimal);
    }
    
    .nav a:active {
        background: rgba(124, 58, 237, 0.15);
    }
    
    .card {
        touch-action: manipulation;
    }
    
    .card:active {
        transform: translateY(-1px) scale(0.99);
    }
    
    /* Amélioration des zones tactiles pour tous les éléments interactifs */
    input, select, textarea, button, a {
        min-height: var(--touch-target-min);
        touch-action: manipulation;
    }
    
    input:focus, select:focus, textarea:focus {
        transform: none; /* Évite les transformations sur mobile */
    }
}

/* =======================
   MODE PAYSAGE MOBILE
   ======================= */
@media (max-height: 500px) and (orientation: landscape) {
    .header-inner {
        flex-direction: row;
        height: 48px;
    }
    
    .nav {
        gap: var(--space-xs);
    }
    
    .nav a {
        padding: var(--space-xs) var(--space-sm);
        min-width: 60px;
    }
    
    .card {
        padding: var(--space-md);
    }
}

/* =======================
   OPTIMISATIONS HAUTE RÉSOLUTION
   ======================= */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* =======================
   AMÉLIORATION DE L'ACCESSIBILITÉ
   ======================= */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

/* Visibilité responsive */
.hidden-mobile {
    display: block;
}

.hidden-desktop {
    display: none;
}

@media (max-width: 767px) {
    .hidden-mobile {
        display: none;
    }
    
    .hidden-desktop {
        display: block;
    }
}

/* Espacement responsive */
.space-responsive {
    margin: var(--space-lg);
}

@media (max-width: 767px) {
    .space-responsive {
        margin: var(--space-md);
    }
}

@media (max-width: 479px) {
    .space-responsive {
        margin: var(--space-sm);
    }
}

/* Texte responsive */
.text-responsive {
    font-size: 1rem;
    line-height: 1.6;
}

@media (max-width: 767px) {
    .text-responsive {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

@media (max-width: 479px) {
    .text-responsive {
        font-size: 0.85rem;
        line-height: 1.4;
    }
}

/* =======================
   DEBUG RESPONSIVE (à supprimer en production)
   ======================= */
/*
.debug-responsive::before {
    content: "XS";
    position: fixed;
    top: 10px;
    right: 10px;
    background: red;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    z-index: 9999;
}

@media (min-width: 480px) {
    .debug-responsive::before { content: "SM"; background: orange; }
}

@media (min-width: 768px) {
    .debug-responsive::before { content: "MD"; background: yellow; color: black; }
}

@media (min-width: 1024px) {
    .debug-responsive::before { content: "LG"; background: green; }
}

@media (min-width: 1200px) {
    .debug-responsive::before { content: "XL"; background: blue; }
}

@media (min-width: 1400px) {
    .debug-responsive::before { content: "2XL"; background: purple; }
}
*/
