/**
 * Global Design System for VPN Admin Panel
 * Modern, Accessible, Optimized
 * v2.0 - November 2025
 */

/* ============================================
   TYPOGRAPHY - Modern Fonts
============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
    /* Primary Font - Inter (UI/Body) */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Secondary Font - Poppins (Headings) */
    --font-secondary: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Monospace Font - Code */
    --font-mono: 'Fira Code', 'Courier New', monospace;
    
    /* ============================================
       COLOR PALETTE
    ============================================ */
    
    /* Primary Colors */
    --primary-500: #667eea;
    --primary-600: #5a67d8;
    --primary-700: #4c51bf;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Secondary Colors */
    --secondary-500: #764ba2;
    --secondary-600: #6b4193;
    --secondary-700: #5f3884;
    
    /* Semantic Colors */
    --success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --success-solid: #10b981;
    --danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --danger-solid: #ef4444;
    --warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --warning-solid: #f59e0b;
    --info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --info-solid: #3b82f6;
    
    /* Neutral Colors */
    --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;
    
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-tertiary: #64748b;
    --text-light: #94a3b8;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    
    /* ============================================
       SPACING
    ============================================ */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */
    
    /* ============================================
       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;  /* Fully rounded */
    
    /* ============================================
       SHADOWS
    ============================================ */
    --shadow-sm: 0 1px 2px 0 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 10px 30px rgba(102, 126, 234, 0.3);
    
    /* ============================================
       TRANSITIONS
    ============================================ */
    --transition-fast: 150ms ease-in-out;
    --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);
}

/* ============================================
   GLOBAL RESETS
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--bg-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY STYLES
============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 800; }
h3 { font-size: 1.75rem; font-weight: 700; }
h4 { font-size: 1.5rem; font-weight: 700; }
h5 { font-size: 1.25rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

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

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

/* ============================================
   LOGO COMPONENT
============================================ */
.logo-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
}

.logo-img {
    width: 48px;
    height: 48px;
    transition: transform var(--transition-base);
}

.logo-img:hover {
    transform: scale(1.05) rotate(5deg);
}

.logo-text {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   BUTTON STYLES
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--gray-200);
    border-color: var(--border-medium);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
}

/* ============================================
   CARD COMPONENT
============================================ */
.card {
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--primary-500);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 2px solid var(--border-light);
}

.card-title {
    font-family: var(--font-secondary);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ============================================
   BADGE COMPONENT
============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary-gradient);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-info {
    background: var(--info);
    color: white;
}

/* ============================================
   INPUT STYLES
============================================ */
input, select, textarea {
    font-family: var(--font-primary);
    font-size: 0.875rem;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================
   RESPONSIVE UTILITIES
============================================ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .card {
        padding: var(--space-lg);
    }
}

/* ============================================
   UTILITY CLASSES
============================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ============================================
   LOADING STATE
============================================ */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.spinner {
    border: 4px solid var(--gray-200);
    border-top: 4px solid var(--primary-500);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

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

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

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

