/**
 * Zorbalama Frontend - Corporate Design System
 * 
 * Minimal, professional SaaS aesthetic with Light/Dark mode support.
 * Corporate design inspired by Linear, Notion, and modern admin panels.
 */

/* ========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   PROFESSIONAL SINGLE THEME
   ======================================== */

:root {
    color-scheme: dark;
    /* --- Base Neutral Colors --- */
    --color-neutral-50: #e8e8e8;
    --color-neutral-100: #d6d6d6;
    --color-neutral-200: #b8b8b8;
    --color-neutral-300: #9a9a9a;
    --color-neutral-400: #7c7c7c;
    --color-neutral-500: #5e5e5e;
    --color-neutral-600: #484848;
    --color-neutral-700: #323232;
    --color-neutral-800: #1c1c1e;
    --color-neutral-900: #121214;
    --color-neutral-950: #0d0d0d;

    /* --- Professional Accent Colors (Muted & Desaturated) --- */
    /* Primary (Muted Slate - Professional) */
    --color-slate-400: #8a9099;
    --color-slate-500: #708090;
    --color-slate-600: #5a6875;
    --color-slate-700: #465160;

    /* Success (Muted Teal - Corporate) */
    --color-success-500: #2d7d6e;
    --color-success-600: #256958;

    /* Warning (Muted Amber - Softer) */
    --color-warning-500: #c07c1a;
    --color-warning-600: #a06515;

    /* Danger (Corporate Red - Toned Down) */
    --color-danger-500: #c85a54;
    --color-danger-600: #a84842;

    /* Info (Subtle Blue - Minimal Use) */
    --color-info-500: #5b8cb8;
    --color-info-600: #4a7399;

    /* --- Typography --- */
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

    /* Font Sizes */
    --font-size-xs: 0.75rem;
    /* 12px */
    --font-size-sm: 0.875rem;
    /* 14px */
    --font-size-base: 1rem;
    /* 16px */
    --font-size-lg: 1.125rem;
    /* 18px */
    --font-size-xl: 1.25rem;
    /* 20px */
    --font-size-2xl: 1.5rem;
    /* 24px */
    --font-size-3xl: 1.875rem;
    /* 30px */
    --font-size-4xl: 2rem;
    /* 32px */
    --font-size-4xl: 2rem;
    /* 32px */


    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* --- Spacing --- */
    --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 */

    /* --- Borders & Radius --- */
    --border-width: 1px;
    --border-radius-sm: 0.375rem;
    /* 6px */
    --border-radius-md: 0.5rem;
    /* 8px */
    --border-radius-lg: 0.75rem;
    /* 12px */
    --border-radius-xl: 1rem;
    /* 16px */
    --border-radius-full: 9999px;

    /* --- Transitions --- */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* --- Z-Index --- */
    --z-dropdown: 1000;
    --z-modal: 2000;
    --z-toast: 3000;
    --z-tooltip: 4000;

    /* ========================================
       PREMIUM DARK THEME COLORS
       ======================================== */

    /* Main Content - Dark Background */
    --color-background: #0a0f1e;
    --color-surface: #111827;
    --color-surface-hover: #1c2437;
    --color-surface-secondary: #0f172a;

    /* Legacy aliases for compatibility */
    --color-bg-primary: var(--color-background);
    --color-bg-secondary: var(--color-surface-secondary);

    /* Main Content - Borders for Dark Mode */
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-light: rgba(255, 255, 255, 0.15);

    /* Main Content - Light Text for Dark Background */
    --color-text-primary: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-text-tertiary: #64748b;

    /* Sidebar - Matches Web Palette */
    --color-sidebar-bg: #0a0f1e;
    --color-sidebar-border: rgba(255, 255, 255, 0.08);
    --color-sidebar-hover: #1c2437;
    --color-sidebar-active: #6366f1;
    --color-sidebar-text-primary: #f8fafc;
    --color-sidebar-text-secondary: #94a3b8;
    --color-sidebar-text-tertiary: #64748b;

    /* Shadows - Custom for Dark Mode (Inner Glow vs outer shadow) */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.7);

    /* Semantic Colors - Indigo Premium Accent */
    --color-primary: #6366f1;
    --color-primary-hover: #818cf8;
}

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-background);
    min-height: 100vh;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-4);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--font-size-4xl);
}

h2 {
    font-size: var(--font-size-3xl);
}

h3 {
    font-size: var(--font-size-2xl);
}

h4 {
    font-size: var(--font-size-xl);
}

h5 {
    font-size: var(--font-size-lg);
}

h6 {
    font-size: var(--font-size-base);
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-primary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* ========================================
   BADGE COMPONENTS
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.375rem;
    white-space: nowrap;
    gap: 0.25rem;
    line-height: 1.2;
}

/* Badge Variants */
.badge-primary {
    background-color: rgba(90, 104, 117, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(90, 104, 117, 0.2);
}

.badge-secondary {
    background-color: rgba(107, 114, 128, 0.1);
    color: var(--color-text-secondary);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.badge-success {
    background-color: rgba(45, 125, 110, 0.1);
    color: var(--color-success-500);
    border: 1px solid rgba(45, 125, 110, 0.2);
}

.badge-warning {
    background-color: rgba(192, 124, 26, 0.1);
    color: var(--color-warning-500);
    border: 1px solid rgba(192, 124, 26, 0.2);
}

.badge-danger {
    background-color: rgba(200, 90, 84, 0.1);
    color: var(--color-danger-500);
    border: 1px solid rgba(200, 90, 84, 0.2);
}

.badge-info {
    background-color: rgba(91, 140, 184, 0.1);
    color: var(--color-info-500);
    border: 1px solid rgba(91, 140, 184, 0.2);
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.container-sm {
    max-width: 640px;
}

.container-lg {
    max-width: 1440px;
}

/* Flexbox utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

/* Grid utilities */
.grid {
    display: grid;
}

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

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

/* Spacing utilities */
.mt-4 {
    margin-top: var(--space-4);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

/* Text utilities */
.text-center {
    text-align: center;
}

.text-sm {
    font-size: var(--font-size-sm);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.font-medium {
    font-weight: var(--font-weight-medium);
}

.font-semibold {
    font-weight: var(--font-weight-semibold);
}

.font-bold {
    font-weight: var(--font-weight-bold);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    border: var(--border-width) solid transparent;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button variants */
.btn-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-light);
}

.btn-danger {
    background: var(--color-danger-500);
    color: white;
    border-color: var(--color-danger-500);
}

.btn-danger:hover {
    background: var(--color-danger-600);
    border-color: var(--color-danger-600);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
}

/* Button sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--font-size-lg);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    font-family: inherit;
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-md);
    transition: all var(--transition-base);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-tertiary);
}

.form-error {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-danger-500);
}

.form-input.error,
.form-textarea.error {
    border-color: var(--color-danger-500);
}

/* ========================================
   CARDS
   ======================================== */

.card {
    background: linear-gradient(150deg, var(--color-surface), rgba(17, 24, 39, 0.7));
    backdrop-filter: blur(12px);
    border: var(--border-width) solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: var(--space-6);
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.4);
    border-color: var(--color-border-light);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: var(--border-width) solid var(--color-border);
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0;
    color: var(--color-text-primary);
}



.card-footer {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: var(--border-width) solid var(--color-border);
}

/* ========================================
   BADGES & PILLS
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    border-radius: var(--border-radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    background: rgba(5, 150, 105, 0.15);
    color: var(--color-success-600);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.15);
    color: var(--color-warning-600);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.15);
    color: var(--color-danger-600);
}

.badge-info {
    background: rgba(100, 116, 139, 0.15);
    color: var(--color-slate-700);
}

html[data-theme="light"] .badge-info {
    color: var(--color-slate-600);
}

/* ========================================
   TABLES
   ======================================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
    border: var(--border-width) solid var(--color-border);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table th {
    padding: var(--space-4);
    text-align: left;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-secondary);
    background: var(--color-surface);
    border-bottom: var(--border-width) solid var(--color-border);
}

.table td {
    padding: var(--space-4);
    border-bottom: var(--border-width) solid var(--color-border);
    color: var(--color-text-primary);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--color-surface-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-clickable tbody tr {
    cursor: pointer;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    :root {
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
    }

    .container {
        padding: 0 var(--space-3);
    }

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

/* ========================================
   ADMIN LAYOUT - PREMIUM THEME
   Styles from chat.css applied globally
   ======================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background: var(--color-sidebar-bg);
    border-right: 1px solid var(--color-sidebar-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
    height: 72px;
    /* Matches header height */
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--color-sidebar-border);
}

.sidebar-logo-icon {
    font-size: 1.5rem;
}

.sidebar-logo-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-sidebar-text-primary);
    letter-spacing: -0.01em;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.sidebar-nav-section {
    margin-bottom: 2rem;
}

.sidebar-nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-sidebar-text-tertiary);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    color: var(--color-sidebar-text-secondary);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-nav-link:hover {
    color: var(--color-sidebar-text-primary);
    background: var(--color-sidebar-hover);
}

.sidebar-nav-link.active {
    background: var(--color-sidebar-active);
    color: white;
    box-shadow: var(--shadow-sm);
}

.sidebar-nav-icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User Section */
.sidebar-user {
    padding: 1rem;
    border-top: 1px solid var(--color-sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    background: var(--color-sidebar-hover);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-sidebar-text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--color-sidebar-border);
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    margin: 0;
    color: var(--color-sidebar-text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    background: transparent;
    border: none;
    color: var(--color-sidebar-text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-logout:hover {
    background: var(--color-sidebar-hover);
    color: var(--color-danger-500);
}

/* Admin Content Area */
.admin-content {
    flex: 1;
    margin-left: 260px;
    /* Width of sidebar */
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Admin Header - Modern & Clean */
.admin-header {
    height: 72px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.85);
    /* Transparent white */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 40;
}

.admin-header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.2;
}

.admin-header-breadcrumb {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
}

/* Mobile Toggle */
.sidebar-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 60;
    display: none;
    /* Hidden on desktop */
    width: 40px;
    height: 40px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Mobile Responsive Layout */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }

    .admin-header {
        padding: 0 1rem;
    }

    .sidebar-toggle {
        display: flex;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }
}

