/* ==========================================================================
   CSS DESIGN SYSTEM - ESPACE NUMÉRIQUE PRIVÉ
   Supports Dark & Light Mode, Responsive SPA layout, Glassmorphism & Animations.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css');

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Root Theme Variables */
:root {
    --font-primary: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Dark Theme Default */
    --bg-main: #0b0f19;
    --bg-sidebar: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.6);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --bg-modal: rgba(15, 23, 42, 0.95);
    --bg-input: #1e293b;
    --border-color: rgba(51, 65, 85, 0.5);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --color-accent: #6366f1; /* Indigo */
    --color-accent-hover: #4f46e5;
    --color-amber: #f59e0b;
    --color-emerald: #10b981;
    --color-rose: #f43f5e;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Overrides */
html.light {
    --bg-main: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: #ffffff;
    --bg-modal: rgba(255, 255, 255, 0.98);
    --bg-input: #f8fafc;
    --border-color: rgba(226, 232, 240, 0.8);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

html.light body {
    background-color: var(--bg-main);
    color: var(--text-primary);
}

html.light .bg-slate-900\/40,
html.light .bg-slate-900\/60,
html.light .bg-slate-900\/80,
html.light .bg-slate-900 {
    background-color: #f8fafc !important;
}

html.light .bg-slate-800\/60,
html.light .bg-slate-800\/40,
html.light .bg-slate-800 {
    background-color: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html.light .text-slate-100,
html.light .text-slate-200 {
    color: #0f172a !important;
}

html.light .text-slate-300,
html.light .text-slate-400 {
    color: #475569 !important;
}

html.light .text-slate-500 {
    color: #64748b !important;
}

html.light .border-slate-800,
html.light .border-slate-700\/50,
html.light .border-slate-700 {
    border-color: #e2e8f0 !important;
}

/* Base resets & typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-h-screen: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

.scrollbar-none::-webkit-scrollbar {
    display: none;
}

/* Buttons System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition-fast);
    cursor: pointer;
    border: 1px solid transparent;
    outline: none;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--color-accent);
}

.btn-accent {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.35);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px 0 rgba(245, 158, 11, 0.5);
}

.btn-danger {
    background-color: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
    background-color: rgba(244, 63, 94, 0.25);
    color: #ffffff;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

/* Modal Backdrops */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 32rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.animate-slide-in {
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Line Clamp Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
