/* ============================================
   MAIN.CSS - Base Styles
   Variables, Reset, Typography, Utilities
   ============================================ */

/* CSS Variables */
:root {
    --primary: #4169e1;
    --primary-dark: #2e4c9e;
    --primary-light: #6b8cff;
    --primary-soft: rgba(65, 105, 225, 0.1);
    --primary-gradient: linear-gradient(135deg, #4169e1, #2e4c9e);
    
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.1);
    
    --light-bg-primary: #ffffff;
    --light-bg-secondary: #f8fafc;
    --light-bg-tertiary: #f1f5f9;
    --light-text-primary: #1e293b;
    --light-text-secondary: #334155;
    --light-text-muted: #64748b;
    --light-border: #e2e8f0;
    
    --dark-bg-primary: #0f172a;
    --dark-bg-secondary: #1e293b;
    --dark-bg-tertiary: #334155;
    --dark-text-primary: #f1f5f9;
    --dark-text-secondary: #cbd5e1;
    --dark-text-muted: #94a3b8;
    --dark-border: #2a3042;
    
    --bg-primary: var(--light-bg-primary);
    --bg-secondary: var(--light-bg-secondary);
    --bg-tertiary: var(--light-bg-tertiary);
    --text-primary: var(--light-text-primary);
    --text-secondary: var(--light-text-secondary);
    --text-muted: var(--light-text-muted);
    --border-color: var(--light-border);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 28px rgba(65, 105, 225, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* Dark Theme */
.dark-theme {
    --bg-primary: var(--dark-bg-primary);
    --bg-secondary: var(--dark-bg-secondary);
    --bg-tertiary: var(--dark-bg-tertiary);
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --text-muted: var(--dark-text-muted);
    --border-color: var(--dark-border);
}

body.dark-theme {
    background: var(--dark-bg-primary);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: all var(--transition-normal);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

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

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

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

/* Utilities */
.text-primary { color: var(--primary) !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; }
.text-muted { color: var(--text-muted) !important; }

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

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.fw-bold { font-weight: 600; }
.fw-normal { font-weight: 400; }

/* Spacing */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }

/* Rounded */
.rounded { border-radius: var(--radius-md); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.rounded-circle { border-radius: 50%; }

/* Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -6px;
    margin-right: -6px;
}

.row > [class*="col-"] {
    padding-left: 6px;
    padding-right: 6px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.333%; }
.col-3 { width: 25%; }
.col-2 { width: 16.666%; }

.g-2 { gap: 6px; }
.g-3 { gap: 8px; }
/* ===== GLOBAL COMPONENTS ===== */
.card {
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    transition: all var(--transition-normal);
}

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

.card-header {
    padding: var(--spacing-md) var(--spacing-md) 0 var(--spacing-md);
    background: transparent;
    border: none;
}

.card-header h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.card-body {
    padding: var(--spacing-md);
}

/* Progress Bar */
.progress {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
/* ===== FORM COMPONENTS ===== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.7rem;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

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

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

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
    margin-bottom: var(--spacing-md);
}

.input-group .form-control {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.input-group .btn {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-text {
    background: var(--primary);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.7rem;
}

/* News Ticker Styles */
.news-ticker {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

/* News Ticker Spacing */
.news-ticker {
    margin-top: 10px;
    margin-bottom: 15px;
}

.news-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.marquee-container {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.marquee {
    display: inline-block;
    white-space: nowrap;
    animation: marqueeRightToLeft 25s linear infinite;
    font-size: 0.85rem;
    color: var(--text-primary);
}

/* Right to Left Animation */
@keyframes marqueeRightToLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Pause on hover */
.marquee:hover {
    animation-play-state: paused;
}
/* ===== TOP SPACING FOR DASHBOARD ===== */
.dashboard-container {
    padding-top: 10px;
}

/* If topbar is fixed, add margin to body */
body {
    padding-top: 70px; /* Adjust based on your topbar height */
}

/* Mobile */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 55px;
    }
}

