/**
 * NET-E Dashboard - Core Application Styles
 * Based on Taiga-Helper Design System
 *
 * This file contains:
 * - CSS Custom Properties (Design Tokens)
 * - Base Reset
 * - Typography
 * - Layout Utilities
 */

/* ============================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================ */

:root {
    /* Primary Brand Gradient */
    --color-primary-start: #667eea;
    --color-primary-end: #764ba2;
    --gradient-primary: linear-gradient(135deg, var(--color-primary-start) 0%, var(--color-primary-end) 100%);

    /* Primary Colors */
    --color-primary: #667eea;
    --color-primary-hover: #5568d3;
    --color-primary-light: #f0f3ff;

    /* Semantic Colors */
    --color-success: #10b981;
    --color-success-bright: #43e97b;
    --color-success-light: #d1fae5;
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-error: #ef4444;
    --color-error-dark: #c33;
    --color-error-light: #fee;
    --color-info: #3b82f6;

    /* Accent Colors */
    --color-accent-pink: #f5576c;
    --color-accent-pink-light: #fff0f2;
    --color-accent-green: #43e97b;
    --color-accent-green-light: #f0fff7;
    --color-accent-orange: #ff6b6b;
    --color-accent-orange-light: #fff5f5;

    /* Text Colors */
    --color-text-primary: #333;
    --color-text-secondary: #555;
    --color-text-tertiary: #666;
    --color-text-muted: #888;
    --color-text-placeholder: #999;
    --color-text-disabled: #ccc;

    /* Background Colors */
    --color-bg-page: #f5f7fa;
    --color-bg-card: #ffffff;
    --color-bg-section: #f9f9f9;
    --color-bg-accent: #f0f3ff;
    --color-bg-hover: #f5f5f5;

    /* Border Colors */
    --color-border-default: #e0e0e0;
    --color-border-light: #f0f0f0;
    --color-border-focus: #667eea;

    /* Font Family */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;

    /* Font Sizes */
    --font-size-xs: 10px;
    --font-size-sm: 11px;
    --font-size-base: 12px;
    --font-size-md: 13px;
    --font-size-lg: 14px;
    --font-size-xl: 16px;
    --font-size-2xl: 18px;
    --font-size-3xl: 20px;
    --font-size-4xl: 22px;
    --font-size-5xl: 24px;
    --font-size-6xl: 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.2;
    --line-height-snug: 1.3;
    --line-height-normal: 1.4;
    --line-height-relaxed: 1.5;
    --line-height-loose: 1.6;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 30px;
    --space-8: 40px;
    --space-9: 48px;
    --space-10: 60px;

    /* Border Radius */
    --radius-sm: 3px;
    --radius-md: 5px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --radius-2xl: 10px;
    --radius-3xl: 12px;
    --radius-4xl: 16px;
    --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);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 12px 24px rgba(102, 126, 234, 0.15);
    --shadow-modal: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-button: 0 10px 20px rgba(102, 126, 234, 0.3);

    /* Transitions */
    --transition-fast: 0.2s;
    --transition-normal: 0.3s;
    --transition-slow: 0.5s;

    /* Container Widths */
    --container-sm: 500px;
    --container-md: 800px;
    --container-lg: 1400px;
    --container-xl: 1600px;

    /* Z-Index Scale */
    --z-dropdown: 100;
    --z-sticky: 100;
    --z-overlay: 500;
    --z-modal: 1000;
    --z-toast: 1100;
}

/* ============================================
   BASE RESET
   ============================================ */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    background-color: var(--color-bg-page);
    min-height: 100vh;
}

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

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

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

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

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-md);
}

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

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

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

strong, b {
    font-weight: var(--font-weight-semibold);
}

small {
    font-size: var(--font-size-md);
    color: var(--color-text-muted);
}

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

.page-wrapper {
    min-height: 100vh;
    background: var(--color-bg-page);
}

.container {
    max-width: var(--container-lg);
    margin: 0 auto;
    padding: var(--space-8) var(--space-7);
}

.container--sm {
    max-width: var(--container-sm);
}

.container--md {
    max-width: var(--container-md);
}

.container--xl {
    max-width: var(--container-xl);
}

/* ============================================
   GRID SYSTEM
   ============================================ */

.grid {
    display: grid;
    gap: var(--space-5);
}

.grid--cards {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.grid--tiles {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-6);
}

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

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

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

@media (max-width: 1200px) {
    .grid--4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .grid--3,
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

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

/* ============================================
   FLEXBOX UTILITIES
   ============================================ */

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-start {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.flex-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

/* ============================================
   SPACING UTILITIES
   ============================================ */

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

/* ============================================
   TEXT UTILITIES
   ============================================ */

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

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-error { color: var(--color-error); }

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

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

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

/* ============================================
   VISIBILITY UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
