/**
 * TCIA Gestão - Theme CSS
 * Sistema de Gestão para Gestores
 * @version 1.0.0
 * 
 * Cores diferenciadas do WMS (roxo/violeta) para identificação rápida
 */

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

/* ========== CSS Variables - Light Theme ========== */
:root {
    /* Cores Primárias - Roxo/Violeta (diferente do WMS azul) */
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-light: #ede9fe;
    --primary-dark: #5b21b6;
    --primary-rgb: 124, 58, 237;
    
    /* Cores de Acento */
    --accent: #f59e0b;
    --accent-hover: #d97706;
    --accent-light: #fef3c7;
    
    /* Cores Semânticas */
    --success: #10b981;
    --success-hover: #059669;
    --success-light: #d1fae5;
    --success-dark: #047857;
    
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --warning-light: #fef3c7;
    --warning-dark: #b45309;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #fee2e2;
    --danger-dark: #b91c1c;
    
    --info: #3b82f6;
    --info-hover: #2563eb;
    --info-light: #dbeafe;
    --info-dark: #1d4ed8;
    
    /* Cores Neutras */
    --secondary: #64748b;
    --secondary-hover: #475569;
    --secondary-light: #f1f5f9;
    
    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-primary: #ffffff;
    --bg-secondary: #f1f5f9;
    --bg-tertiary: #e2e8f0;
    --bg-hover: #f1f5f9;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(15, 23, 42, 0.5);
    
    /* Surfaces */
    --surface: #ffffff;
    --surface-hover: #f8fafc;
    --surface-active: #f1f5f9;
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --text-muted: #cbd5e1;
    --text-inverse: #ffffff;
    --text-link: var(--primary);
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --border-hover: #cbd5e1;
    --border-focus: var(--primary);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
    --shadow-primary: 0 4px 14px 0 rgba(124, 58, 237, 0.3);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --gradient-dark: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Border Radius */
    --radius-xs: 0.125rem;
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --header-height: 64px;
    --content-max-width: 1600px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Andale Mono', monospace;
    
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    
    /* Charts Colors */
    --chart-1: #7c3aed;
    --chart-2: #3b82f6;
    --chart-3: #10b981;
    --chart-4: #f59e0b;
    --chart-5: #ef4444;
    --chart-6: #ec4899;
    --chart-7: #06b6d4;
    --chart-8: #84cc16;
    
    /* Status Colors */
    --status-online: #10b981;
    --status-offline: #ef4444;
    --status-busy: #f59e0b;
    --status-away: #6b7280;
}

/* ========== Dark Theme ========== */
[data-theme="dark"] {
    /* Cores Primárias - Ajustadas para dark */
    --primary: #a78bfa;
    --primary-hover: #8b5cf6;
    --primary-light: rgba(167, 139, 250, 0.15);
    --primary-dark: #7c3aed;
    
    /* Backgrounds */
    --bg-body: #0f0d1a;
    --bg-primary: #1a1625;
    --bg-secondary: #241f31;
    --bg-tertiary: #2e2840;
    --bg-hover: #352f47;
    --bg-elevated: #1f1a2e;
    --bg-overlay: rgba(0, 0, 0, 0.7);
    
    /* Surfaces */
    --surface: #1a1625;
    --surface-hover: #241f31;
    --surface-active: #2e2840;
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    --text-muted: #52525b;
    
    /* Borders */
    --border-color: #2e2840;
    --border-light: #241f31;
    --border-hover: #3f3757;
    
    /* Shadows - mais intensas no dark */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    --shadow-primary: 0 4px 14px 0 rgba(167, 139, 250, 0.25);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    --gradient-dark: linear-gradient(135deg, #0f0d1a 0%, #1a1625 100%);
    --gradient-surface: linear-gradient(180deg, #1a1625 0%, #0f0d1a 100%);
    
    /* Status Colors - mais vibrantes no dark */
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.15);
    --info: #60a5fa;
    --info-light: rgba(96, 165, 250, 0.15);
}

/* ========== Global Styles ========== */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* ========== Typography ========== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
    margin: 0;
}

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: 0 0 var(--spacing-md) 0;
    color: var(--text-secondary);
}

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

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

small {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.125rem 0.375rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--primary);
}

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

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

/* ========== Scrollbar ========== */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

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

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

*::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--border-hover);
}

/* ========== Focus Styles ========== */
:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ========== Utility Classes ========== */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-warning { background-color: var(--warning) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-info { background-color: var(--info) !important; }

.font-medium { font-weight: var(--font-weight-medium) !important; }
.font-semibold { font-weight: var(--font-weight-semibold) !important; }
.font-bold { font-weight: var(--font-weight-bold) !important; }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ========== Animation Classes ========== */
.animate-fade-in { animation: fadeIn var(--transition) ease-out; }
.animate-fade-in-up { animation: fadeInUp var(--transition) ease-out; }
.animate-fade-in-down { animation: fadeInDown var(--transition) ease-out; }
.animate-slide-in-left { animation: slideInLeft var(--transition) ease-out; }
.animate-slide-in-right { animation: slideInRight var(--transition) ease-out; }
.animate-scale-in { animation: scaleIn var(--transition) ease-out; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-bounce { animation: bounce 1s infinite; }

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

/* ========== Responsive ========== */
@media screen and (max-width: 1440px) {
    html {
        font-size: 15px;
    }
}

@media screen and (max-width: 1024px) {
    html {
        font-size: 14px;
    }
    
    :root {
        --sidebar-width: 240px;
    }
}

@media screen and (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    :root {
        --header-height: 56px;
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 13px;
    }
}

/* ========== Print Styles ========== */
@media print {
    * {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .no-print {
        display: none !important;
    }
}