/* ===========================================
   BASE TYPOGRAPHY & GLOBAL STYLES
   All views should import this file first
   =========================================== */

/* CSS Custom Properties - Design Tokens */
:root {
    /* Colors */
    --primary-color: #047b01d2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --primary-bg: #2c3e50;
    
    /* Typography - Unified Font System */
    --font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Font Sizes - Consistent Scale */
    --font-size-xs: 0.75rem;      /* 12px - Small labels, badges */
    --font-size-sm: 0.875rem;     /* 14px - Secondary text, table cells */
    --font-size-base: 1rem;       /* 16px - Body text, inputs */
    --font-size-md: 1.125rem;     /* 18px - Card titles, section headers */
    --font-size-lg: 1.25rem;      /* 20px - Subheadings */
    --font-size-xl: 1.5rem;       /* 24px - Page section titles */
    --font-size-2xl: 1.75rem;     /* 28px - Page headers */
    --font-size-3xl: 2rem;        /* 32px - Main titles (auth pages) */
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

/* Base Body Styles */
body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--gray-900);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Hierarchy */
h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-xs);
}

h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-sm);
}

h3 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-sm);
}

h4 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
}

h5, h6 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-normal);
}

p {
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    color: var(--gray-200);
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
}

/* Form Elements - Unified Styling */
input, select, textarea {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    color: var(--gray-900);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(4, 123, 1, 0.1);
}

input::placeholder, textarea::placeholder {
    color: var(--gray-500);
}

label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
}

/* Buttons - Unified Styling */
button, .btn {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

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

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

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

.btn-warning:hover {
    background: #d97706;
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Tables - Unified Styling */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

th {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-700);
    padding: 16px 12px;
    text-align: left;
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-300);
}

td {
    font-size: var(--font-size-sm);
    padding: 16px 12px;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-200);
    vertical-align: top;
}

tbody tr:hover {
    background: var(--gray-50);
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    background: var(--gray-50);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--gray-200);
}

.card-header h5 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--gray-900);
    margin: 0;
}

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

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

/* Utility Classes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }

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

.text-gray-500 { color: var(--gray-500); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-900 { color: var(--gray-900); }

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

    /* Touch-friendly minimum sizes */
    button, .btn, select, input, textarea {
        min-height: 44px;
    }

    /* Improve scrolling */
    .table-container,
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Better spacing on mobile */
    .container {
        border-radius: 0;
    }

    /* Hide on mobile utility */
    .hide-mobile {
        display: none !important;
    }

    /* Full width on mobile utility */
    .full-width-mobile {
        width: 100% !important;
    }

    /* Stack on mobile utility */
    .stack-mobile {
        flex-direction: column !important;
    }

    /* Center on mobile utility */
    .center-mobile {
        text-align: center !important;
        justify-content: center !important;
    }
}

/* Show only on mobile utility */
.show-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block !important;
    }

    .show-mobile-flex {
        display: flex !important;
    }
}

/* Smooth scrolling for all pages */
html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
}
