/* ========================================
   THEME SYSTEM - CSS VARIABLES
   Light & Dark Mode Support
======================================== */

:root {
    /* ========== LIGHT MODE COLORS ========== */
    
    /* Background Colors */
    --bg-primary: #ffffff;              /* Main background */
    --bg-secondary: #f9fafb;           /* Secondary background */
    --bg-theme-card: #ffffff;          /* Card background */
    --bg-tertiary: #f3f4f6;            /* Tertiary background */
    
    /* Text Colors */
    --text-primary: #111827;           /* Primary text (black) */
    --text-secondary: #4b5563;         /* Secondary text (gray-600) */
    --text-tertiary: #6b7280;          /* Tertiary text (gray-500) */
    --text-muted: #9ca3af;             /* Muted text (gray-400) */
    --text-inverted: #ffffff;          /* White text for dark backgrounds */
    
    /* Theme Colors */
    --theme-primary: #3b82f6;          /* Blue-500 */
    --theme-primary-dark: #2563eb;     /* Blue-600 */
    --theme-accent: #06b6d4;           /* Cyan-500 */
    --theme-success: #10b981;          /* Green-500 */
    --theme-warning: #f59e0b;          /* Amber-500 */
    --theme-danger: #ef4444;           /* Red-500 */
    
    /* Border & Divider */
    --border-color: #e5e7eb;           /* Gray-200 */
    --border-light: #f3f4f6;           /* Gray-100 */
    --border-dark: #d1d5db;            /* Gray-300 */
    
    /* Form Elements */
    --input-bg: #ffffff;
    --input-border: #d1d5db;           /* Gray-300 */
    --input-text: #111827;
    --input-placeholder: #9ca3af;      /* Gray-400 */
    --input-focus-border: #3b82f6;
    --input-focus-ring: rgba(59, 130, 246, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    /* Radius */
    --radius-sm: 0.375rem;             /* 6px */
    --radius-md: 0.5rem;               /* 8px */
    --radius-lg: 0.75rem;              /* 12px */
    --radius-xl: 1rem;                 /* 16px */
    --radius-theme: 0.75rem;           /* Default theme radius */
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

.dark {
    /* ========== DARK MODE COLORS ========== */
    
    /* Background Colors */
    --bg-primary: #111827;             /* Gray-900 */
    --bg-secondary: #1f2937;           /* Gray-800 */
    --bg-theme-card: #1f2937;          /* Gray-800 */
    --bg-tertiary: #374151;            /* Gray-700 */
    
    /* Text Colors */
    --text-primary: #f9fafb;           /* Gray-50 */
    --text-secondary: #d1d5db;         /* Gray-300 */
    --text-tertiary: #9ca3af;          /* Gray-400 */
    --text-muted: #6b7280;             /* Gray-500 */
    --text-inverted: #111827;          /* Dark text for light backgrounds */
    
    /* Theme Colors (slightly adjusted for dark mode) */
    --theme-primary: #60a5fa;          /* Blue-400 */
    --theme-primary-dark: #3b82f6;     /* Blue-500 */
    --theme-accent: #22d3ee;           /* Cyan-400 */
    --theme-success: #34d399;          /* Green-400 */
    --theme-warning: #fbbf24;          /* Amber-400 */
    --theme-danger: #f87171;           /* Red-400 */
    
    /* Border & Divider */
    --border-color: #374151;           /* Gray-700 */
    --border-light: #1f2937;           /* Gray-800 */
    --border-dark: #4b5563;            /* Gray-600 */
    
    /* Form Elements */
    --input-bg: #1f2937;               /* Gray-800 */
    --input-border: #374151;           /* Gray-700 */
    --input-text: #f9fafb;             /* Gray-50 */
    --input-placeholder: #9ca3af;      /* Gray-400 */
    --input-focus-border: #60a5fa;     /* Blue-400 */
    --input-focus-ring: rgba(96, 165, 250, 0.2);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

/* ========================================
   TOKEN CLASSES - Apply Variables
======================================== */

/* Background Classes */
.bg-primary { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-theme-card { background-color: var(--bg-theme-card); }
.bg-tertiary { background-color: var(--bg-tertiary); }

/* Text Classes */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-muted { color: var(--text-muted); }
.text-inverted { color: var(--text-inverted); }

/* Theme Color Classes */
.text-theme-primary { color: var(--theme-primary); }
.bg-theme-primary { background-color: var(--theme-primary); }
.border-theme-primary { border-color: var(--theme-primary); }

.text-theme-accent { color: var(--theme-accent); }
.bg-theme-accent { background-color: var(--theme-accent); }

/* Border Classes */
.border-color { border-color: var(--border-color); }
.border-light { border-color: var(--border-light); }
.border-dark { border-color: var(--border-dark); }

/* Rounded */
.rounded-theme { border-radius: var(--radius-theme); }

/* ========================================
   COMPONENT CLASSES
======================================== */

/* Card Component */
.card {
    background: var(--bg-theme-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-theme);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* Form Control */
.form-control {
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    color: var(--input-text);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

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

.form-control:focus {
    outline: none;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button Component */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--theme-primary);
    color: white;
}

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

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

/* Badge Component */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

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

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

/* Link Styles */
a {
    color: var(--theme-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--theme-accent);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.pagination a:hover {
    background: var(--bg-theme-card);
    border-color: var(--theme-primary);
    color: var(--theme-primary);
}

.pagination .active {
    background: var(--theme-primary);
    border-color: var(--theme-primary);
    color: white;
}

/* Line Clamp Utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Icon Colors */
.fas, .fa {
    color: var(--text-secondary);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

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

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