/* Font Awesome compatibility: keep classic and v6 class prefixes rendering consistently */
.fa, .fas, .fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
}

.far, .fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 400 !important;
}

.fab, .fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-weight: 400 !important;
}

/* ============================================
   BASE.CSS - Core Styles & Variables
   Version: 3.0 - Professional Edition
   ============================================ */

/* ------------------------------
   CSS Variables (Design Tokens)
------------------------------ */
:root {
    /* Colors - Primary Brand */
    --primary: #6a4bc3;
    --primary-light: #8f74e6;
    --primary-dark: #4a2d8a;
    --primary-alpha: rgba(106, 75, 195, 0.12);
    --primary-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);

    /* Colors - Semantic / Feedback */
    --success: #10b981;
    --success-light: #34d399;
    --success-dark: #059669;
    --success-alpha: rgba(16, 185, 129, 0.12);

    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --warning-dark: #d97706;
    --warning-alpha: rgba(245, 158, 11, 0.12);

    --danger: #ef4444;
    --danger-light: #f87171;
    --danger-dark: #dc2626;
    --danger-alpha: rgba(239, 68, 68, 0.12);

    --info: #3b82f6;
    --info-light: #60a5fa;
    --info-dark: #2563eb;
    --info-alpha: rgba(59, 130, 246, 0.12);

    /* Colors - Grayscale */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --black: #000000;

    /* Colors - Warm Neutrals (For Sewing Studio Theme) */
    --warm-50: #fefaf5;
    --warm-100: #fdf3e6;
    --warm-200: #fae8cc;
    --warm-300: #f5d4a8;
    --warm-400: #e8b96a;
    --warm-500: #d99e4f;
    --warm-600: #c47d3a;
    --warm-700: #9e5e2a;

    /* Atelier Dark Mode (Luxury High-End) */
    --bg-deep: #131113;
    --panel-dark: #1c191c;
    --panel-border: #332d33;
    --text-linen: #fcfaf7;
    --text-muted: #a19b95;
    --rose-gold-gradient: linear-gradient(135deg, #c5867d 0%, #b87333 100%);
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);

    /* Aliases referenced by admin templates (kept here so they always resolve) */
    --border: var(--panel-border);     /* subtle border on dark admin panels */
    --surface-warm: #211d21;           /* warm-tinted dark surface (hover/rows) */
    --duration-fast: 0.15s;            /* quick UI transitions */
    --duration-base: 0.25s;            /* standard UI transitions */
}

.btn {
    transition: transform 0.1s cubic-bezier(0.2, 0.8, 0.4, 1), background-color 0.2s ease;
}
.btn:active {
    transform: scale(0.96);
}

.atelier-theme {
    background-color: var(--bg-deep);
    color: var(--text-linen);
    font-family: var(--font-secondary);
}
.atelier-theme .sidebar {
    background-color: var(--panel-dark) !important;
    border-right-color: var(--panel-border) !important;
}
.atelier-theme .nav-link {
    color: var(--text-linen) !important;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.atelier-theme .nav-link:hover {
    color: var(--text-linen) !important;
    background-color: rgba(252, 250, 247, 0.05);
}
.atelier-theme .card {
    background-color: var(--panel-dark) !important;
    border: 1px solid var(--panel-border) !important;
    color: var(--text-linen) !important;
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-xl);
    padding: 2.5rem; /* Generous whitespace */
}
.atelier-theme .text-muted {
    color: var(--text-muted) !important;
}
.atelier-theme .text-dark {
    color: var(--text-linen) !important;
}

:root {
    /* Typography */
    --font-primary: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Font Sizes */
    --text-xs: 0.75rem;     /* 12px */
    --text-sm: 0.875rem;    /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg: 1.125rem;    /* 18px */
    --text-xl: 1.25rem;     /* 20px */
    --text-2xl: 1.5rem;     /* 24px */
    --text-3xl: 1.875rem;   /* 30px */
    --text-4xl: 2.25rem;    /* 36px */
    --text-5xl: 3rem;       /* 48px */

    /* Font Weights */
    --fw-light: 300;
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;

    /* Line Heights */
    --leading-none: 1;
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;

    /* Spacing */
    --space-0: 0;
    --space-1: 0.25rem;     /* 4px */
    --space-2: 0.5rem;      /* 8px */
    --space-3: 0.75rem;     /* 12px */
    --space-4: 1rem;        /* 16px */
    --space-5: 1.25rem;     /* 20px */
    --space-6: 1.5rem;      /* 24px */
    --space-8: 2rem;        /* 32px */
    --space-10: 2.5rem;     /* 40px */
    --space-12: 3rem;       /* 48px */
    --space-16: 4rem;       /* 64px */
    --space-20: 5rem;       /* 80px */
    --space-24: 6rem;       /* 96px */

    /* Border Radius */
    --radius-sm: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-warm: 0 8px 30px rgba(106, 75, 195, 0.15);
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.1);

    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.35);
    --glass-blur: blur(12px);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Z-Index Layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* Dark Mode */
[data-theme="dark"],
.dark-mode {
    --glass-bg: rgba(26, 26, 46, 0.85);
    --white: #1a1a2e;
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-200: #4b5563;
    --gray-300: #6b7280;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #f3f4f6;
    --gray-800: #f9fafb;
    --gray-900: #ffffff;
}

/* ------------------------------
   Reset & Base Styles
------------------------------ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 19px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    /* Zara-style Typography */
    line-height: 1.6;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

body {
    font-family: var(--font-secondary);
    font-size: var(--text-base);
    font-weight: var(--fw-normal);
    line-height: var(--leading-normal);
    color: var(--gray-800);
    background: linear-gradient(135deg, #fef9f0 0%, #fff5e6 100%);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Dark Mode Body Background */
body.dark-mode,
[data-theme="dark"] body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

/* ------------------------------
   Typography
------------------------------ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--fw-bold);
    line-height: var(--leading-tight);
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

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

/* Responsive Typography */
@media (max-width: 768px) {
    html { font-size: 16px; }
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }
    h4 { font-size: var(--text-lg); }
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary);
}

/* Text Selection */
::selection {
    background: var(--primary-alpha);
    color: var(--primary-dark);
}

::-moz-selection {
    background: var(--primary-alpha);
    color: var(--primary-dark);
}

/* ------------------------------
   Scrollbar Styling
------------------------------ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

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

/* ------------------------------
   Background Glows
------------------------------ */@keyframes floatGlow {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(50px, 50px);
    }
}
/* ------------------------------
   Glass Effect
------------------------------ */
.glass {
    background: var(--glass-bg);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .glass {
        background: rgba(255, 255, 255, 0.96);
    }
}

/* ------------------------------
   Container & Layout
------------------------------ */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-8);
    }
}

.admin-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-6);
}

@media (min-width: 768px) {
    .admin-container {
        padding: var(--space-8);
    }
}

/* ------------------------------
   Welcome Section
------------------------------ */
.welcome-section {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
}

@media (min-width: 768px) {
    .welcome-section {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

.atelier-title {
    font-size: 1.8rem;
    font-weight: var(--fw-bold);
    color: var(--gray-800);
    margin-bottom: var(--space-1);
    background: var(--primary-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.atelier-subtitle {
    color: var(--gray-600);
    font-size: var(--text-sm);
}

.date-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    font-weight: var(--fw-medium);
    font-size: var(--text-sm);
    border: 1px solid var(--glass-border);
}

/* ------------------------------
   Utility Classes
------------------------------ */
/* Text Colors */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted { color: var(--gray-500); }

/* Background Colors */
.bg-primary { background: var(--primary-gradient); }
.bg-primary-alpha { background: var(--primary-alpha); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }
/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Disabled State */
.disabled,
[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ------------------------------
   Print Styles
------------------------------ */
@media print {
    .glow,
    .glass,
    .social-links,
    .navbar,
    footer {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}

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

    .glow {
        animation: none;
    }
}

/* ------------------------------
   Global UI Reliability Upgrades
------------------------------ */
.btn,
button.btn,
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    line-height: 1.2;
}

.btn i,
.btn .fa,
.btn .fas,
.btn .far,
.btn .fa-solid,
.btn .fa-regular {
    width: 1.05em;
    text-align: center;
    flex: 0 0 auto;
}

.btn:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn[disabled],
.btn.disabled {
    opacity: 0.55;
    pointer-events: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: none;
    }

    .btn,
    button,
    [role="button"],
    .nav-link,
    .social-link {
        min-height: 44px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }
}

@media (forced-colors: active) {
    .glass {
        border: 1px solid CanvasText;
        background: Canvas;
        box-shadow: none;
    }
}

/* ============================================
   TOOLTIP SYSTEM
   Usage: add data-tooltip="Label" to any element.
   JS in base.html auto-copies title/aria-label → data-tooltip.
   ============================================ */

[data-tooltip] {
    position: relative;
}

/* The tooltip bubble */
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    white-space: nowrap;
    background: rgba(17, 17, 17, 0.88);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.65rem;
    border-radius: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: var(--z-tooltip, 1070);
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    /* Clamp inside viewport: don't overflow left edge */
    max-width: 180px;
    text-align: center;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Arrow pointing down toward the element */
[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 4px solid transparent;
    border-top-color: rgba(17, 17, 17, 0.88);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: var(--z-tooltip, 1070);
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip positioned below (data-tooltip-pos="bottom") */
[data-tooltip][data-tooltip-pos="bottom"]::after {
    bottom: auto;
    top: calc(100% + 7px);
    transform: translateX(-50%) translateY(-4px);
}
[data-tooltip][data-tooltip-pos="bottom"]::before {
    bottom: auto;
    top: calc(100% + 2px);
    border-top-color: transparent;
    border-bottom-color: rgba(17, 17, 17, 0.88);
    transform: translateX(-50%) translateY(-4px);
}
[data-tooltip][data-tooltip-pos="bottom"]:hover::after,
[data-tooltip][data-tooltip-pos="bottom"]:focus-visible::after {
    transform: translateX(-50%) translateY(0);
}
[data-tooltip][data-tooltip-pos="bottom"]:hover::before,
[data-tooltip][data-tooltip-pos="bottom"]:focus-visible::before {
    transform: translateX(-50%) translateY(0);
}

/* Touch devices: keep tooltips off to avoid sticky state */
@media (hover: none) and (pointer: coarse) {
    [data-tooltip]::after,
    [data-tooltip]::before { display: none; }
}