/*
 * TacticalHQ Design System
 * Conversio Branding - Square Corners, Modern Professional Look
 *
 * USAGE: Import this file FIRST in all HTML pages:
 * <link rel="stylesheet" href="/styles/design-system.css">
 *
 * All CSS values should reference these variables for consistency.
 * Changing a value here updates it across the entire application.
 */

:root {
    /* ========== COLORS - Primary ========== */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    --color-primary-rgb: 99, 102, 241;

    /* Primary Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --gradient-primary-hover: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    --gradient-brand: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* ========== COLORS - Semantic ========== */
    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-success-light: #d1fae5;

    --color-warning: #f59e0b;
    --color-warning-dark: #d97706;
    --color-warning-light: #fef3c7;

    --color-error: #ef4444;
    --color-error-dark: #dc2626;
    --color-error-light: #fee2e2;

    --color-info: #3b82f6;
    --color-info-dark: #2563eb;
    --color-info-light: #dbeafe;

    /* ========== COLORS - Neutrals ========== */
    --color-white: #ffffff;
    --color-black: #000000;

    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* ========== COLORS - Backgrounds ========== */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-sidebar: #1a202c;
    --bg-sidebar-dark: #0f172a;

    /* ========== COLORS - Borders ========== */
    --border-color: #e2e8f0;
    --border-color-dark: #cbd5e1;
    --border-color-light: #f1f5f9;

    /* ========== COLORS - Text ========== */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;

    /* ========== TYPOGRAPHY ========== */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;

    --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: 2.25rem;   /* 36px */

    --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.75;

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

    /* ========== BORDER RADIUS - CONVERSIO STYLE: SQUARE CORNERS ========== */
    /* All values set to 0 for the Conversio square corners branding */
    --radius-none: 0;
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
    --radius-2xl: 0;
    --radius-full: 9999px; /* Keep for avatars/circles */

    /* ========== SHADOWS ========== */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --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-primary: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
    --shadow-primary-lg: 0 6px 20px rgba(99, 102, 241, 0.4);

    /* ========== TRANSITIONS ========== */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;

    /* ========== Z-INDEX ========== */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 400;
    --z-modal: 500;
    --z-popover: 600;
    --z-tooltip: 700;

    /* ========== LAYOUT ========== */
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --container-max-width: 1400px;
}

/* ========== GLOBAL RESET WITH DESIGN SYSTEM ========== */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ========== UTILITY CLASSES ========== */

/* Border Radius Utilities */
.rounded-none { border-radius: var(--radius-none) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }
.shadow-none { box-shadow: none !important; }

/* Spacing Utilities */
.p-0 { padding: var(--spacing-0) !important; }
.p-1 { padding: var(--spacing-1) !important; }
.p-2 { padding: var(--spacing-2) !important; }
.p-3 { padding: var(--spacing-3) !important; }
.p-4 { padding: var(--spacing-4) !important; }
.p-5 { padding: var(--spacing-5) !important; }
.p-6 { padding: var(--spacing-6) !important; }
.p-8 { padding: var(--spacing-8) !important; }

.m-0 { margin: var(--spacing-0) !important; }
.m-1 { margin: var(--spacing-1) !important; }
.m-2 { margin: var(--spacing-2) !important; }
.m-3 { margin: var(--spacing-3) !important; }
.m-4 { margin: var(--spacing-4) !important; }
.m-5 { margin: var(--spacing-5) !important; }
.m-6 { margin: var(--spacing-6) !important; }
.m-8 { margin: var(--spacing-8) !important; }

/* Gap Utilities */
.gap-1 { gap: var(--spacing-1) !important; }
.gap-2 { gap: var(--spacing-2) !important; }
.gap-3 { gap: var(--spacing-3) !important; }
.gap-4 { gap: var(--spacing-4) !important; }
.gap-5 { gap: var(--spacing-5) !important; }
.gap-6 { gap: var(--spacing-6) !important; }

/* Text Color Utilities */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-error { color: var(--color-error) !important; }

/* Background Color Utilities */
.bg-primary { background-color: var(--bg-primary) !important; }
.bg-secondary { background-color: var(--bg-secondary) !important; }
.bg-tertiary { background-color: var(--bg-tertiary) !important; }

/* ========== COMMON COMPONENT STYLES ========== */

/* Cards - Square corners */
.ds-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-6);
    transition: all var(--transition-normal);
}

.ds-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Buttons */
.ds-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    padding: var(--spacing-3) var(--spacing-5);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.ds-btn-primary {
    background: var(--gradient-primary);
    color: var(--text-inverse);
    box-shadow: var(--shadow-primary);
}

.ds-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
}

.ds-btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.ds-btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color-dark);
}

/* Inputs */
.ds-input {
    width: 100%;
    padding: var(--spacing-3) var(--spacing-4);
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.ds-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

/* Badges */
.ds-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-sm);
}

.ds-badge-primary {
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
}

.ds-badge-success {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.ds-badge-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.ds-badge-error {
    background: var(--color-error-light);
    color: var(--color-error-dark);
}

/* Section Titles */
.ds-section-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--spacing-5);
    display: flex;
    align-items: center;
    gap: var(--spacing-2);
}

/* Accent Bar (left border) */
.ds-accent-left {
    border-left: 4px solid var(--color-primary);
}

/* Tag Pills */
.ds-tag {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-1) var(--spacing-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    background: var(--gradient-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-sm);
}

/* ========== OVERRIDE EXISTING ROUNDED CORNERS ========== */
/* This section applies square corners to common selectors */

.modal-content,
.stat-card,
.client-card,
.client-logo,
.platform-badge,
.client-settings-btn,
.meta-badge,
.new-report-badge,
.btn,
.history-toggle,
.history-dropdown,
.history-item,
.history-item-link,
.history-item-delete,
.topbar-btn,
.user-menu,
.user-dropdown,
.user-dropdown-item,
.queue-stat-card,
.queue-tab,
.queue-job-item,
.form-group input,
.form-group textarea,
.form-group select,
.news-section,
.action-card,
.feature-card,
.feature-card-icon,
.stat-card-icon,
.news-title-icon,
.btn-refresh,
.loading-spinner,
.impersonation-banner,
.btn-stop-impersonation {
    border-radius: var(--radius-md) !important;
}

/* Keep circular elements circular */
.user-avatar,
.status-badge,
.spinner {
    border-radius: var(--radius-full) !important;
}
