/* 🎨 TEDDY PAINT DESIGN SYSTEM */

:root {
    /* Couleurs principales */
    --background: hsl(45, 100%, 98%);
    --foreground: hsl(220, 15%, 20%);
    
    --primary: hsl(25, 95%, 53%);
    --primary-foreground: hsl(0, 0%, 100%);
    
    --secondary: hsl(180, 75%, 45%);
    --secondary-foreground: hsl(0, 0%, 100%);
    
    --accent: hsl(340, 85%, 58%);
    --accent-foreground: hsl(0, 0%, 100%);
    
    --success: hsl(145, 70%, 48%);
    --success-foreground: hsl(0, 0%, 100%);
    
    --warning: hsl(45, 100%, 55%);
    --warning-foreground: hsl(220, 15%, 20%);
    
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(220, 15%, 20%);
    
    --muted: hsl(45, 40%, 94%);
    --muted-foreground: hsl(220, 10%, 45%);
    
    --border: hsl(45, 30%, 88%);
    --input: hsl(45, 30%, 88%);
    
    /* Ombres */
    --shadow-primary: 0 10px 30px -10px hsla(25, 95%, 53%, 0.3);
    --shadow-secondary: 0 10px 30px -10px hsla(180, 75%, 45%, 0.3);
    --shadow-soft: 0 4px 20px -4px hsla(220, 15%, 20%, 0.08);
    
    --radius: 1.5rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.2;
}

button, a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Utilitaires */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.min-h-screen {
    min-height: 100vh;
}

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

.text-gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border: none;
    border-radius: 9999px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

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

@keyframes fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-color {
    0%, 100% { box-shadow: 0 0 0 0 hsla(25, 95%, 53%, 0.4); }
    50% { box-shadow: 0 0 0 20px hsla(25, 95%, 53%, 0); }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.animate-bounce-gentle {
    animation: bounce-gentle 2s ease-in-out infinite;
}

.animate-fade-in {
    animation: fade-in 1s ease-out;
}

.pulse-color {
    animation: pulse-color 2s ease-in-out infinite;
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Grid System */
.grid {
    display: grid;
    gap: 2rem;
}

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

/* Responsive */
@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .md-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .lg-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Spacing */
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-8 { margin-top: 2rem; }
.mt-16 { margin-top: 4rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Backgrounds */
.bg-gradient-to-b {
    background: linear-gradient(to bottom, var(--background), var(--muted));
}

.bg-muted {
    background: var(--muted);
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 1rem;
    animation: fade-in 0.3s ease-out;
    max-width: 400px;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.toast-description {
    color: var(--muted-foreground);
    font-size: 0.9rem;
}


/* ========================================
   MULTILINGUAL & THEME SYSTEM
   ======================================== */

/* Language Selector & Theme Toggle Container */
.top-controls {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.lang-toggle:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-primary);
    border-color: var(--primary);
}

.lang-toggle .flag {
    font-size: 1.25rem;
}

.lang-toggle .lang-name {
    font-size: 0.875rem;
}

.lang-toggle .chevron {
    transition: transform 0.3s ease;
}

.lang-toggle.active .chevron {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--foreground);
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: var(--muted);
}

.lang-option.active {
    background: var(--primary);
    color: var(--primary-foreground);
    font-weight: 700;
}

.lang-option .flag {
    font-size: 1.5rem;
}

.lang-option .lang-name {
    flex: 1;
}

.lang-option .check {
    width: 1rem;
    height: 1rem;
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
}

.theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.theme-btn:hover {
    transform: scale(1.05) rotate(15deg);
    box-shadow: var(--shadow-primary);
    border-color: var(--primary);
}

.theme-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: all 0.3s ease;
}

.sun-icon {
    display: block;
}

.moon-icon {
    display: none;
}

/* Dark Mode Styles */
[data-theme="dark"] {
    --background: hsl(220, 20%, 12%);
    --foreground: hsl(45, 100%, 98%);
    
    --card: hsl(220, 20%, 15%);
    --card-foreground: hsl(45, 100%, 98%);
    
    --popover: hsl(220, 20%, 15%);
    --popover-foreground: hsl(45, 100%, 98%);
    
    --primary: hsl(25, 95%, 58%);
    --primary-foreground: hsl(0, 0%, 100%);
    
    --secondary: hsl(180, 75%, 50%);
    --secondary-foreground: hsl(0, 0%, 100%);
    
    --accent: hsl(340, 85%, 62%);
    --accent-foreground: hsl(0, 0%, 100%);
    
    --muted: hsl(220, 15%, 20%);
    --muted-foreground: hsl(220, 10%, 65%);
    
    --border: hsl(220, 15%, 25%);
    --input: hsl(220, 15%, 25%);
    
    --shadow-primary: 0 10px 30px -10px hsla(25, 95%, 58%, 0.4);
    --shadow-secondary: 0 10px 30px -10px hsla(180, 75%, 50%, 0.4);
    --shadow-soft: 0 4px 20px -4px hsla(0, 0%, 0%, 0.3);
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-btn {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--primary-foreground);
}

/* Responsive */
@media (max-width: 768px) {
    .top-controls {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.25rem;
    }
    
    .lang-toggle .lang-name {
        display: none;
    }
    
    .lang-toggle {
        padding: 0.5rem;
        width: 3rem;
        height: 3rem;
        justify-content: center;
    }
    
    .theme-btn {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .lang-menu {
        right: auto;
        left: 0;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] {
    direction: rtl;
}

[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .top-controls {
    right: auto;
    left: 1rem;
}

/* Smooth transitions for theme change */
body, .card, .btn, input, textarea, select {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}
