/**
 * Main Stylesheet
 * E-CIYOTA System
 * 
 * This file contains global styles used across the entire system
 */

/* ============================================
   CSS VARIABLES - CIYOTA Color Scheme
   ============================================ */
:root {
    /* CIYOTA Official Colors */
    --ciyota-navy: #10235e;         /* Resilient Navy - Primary brand color */
    --ciyota-yellow: #ffc32c;       /* Radiant Yellow - Accent color */
    --ciyota-navy-dark: #0a1842;    /* Darker Navy - For hover states */
    --ciyota-yellow-dark: #e6a600;  /* Darker Yellow - For hover states */
    --ciyota-navy-light: #1a3478;   /* Lighter Navy - For backgrounds */
    
    /* Neutral Colors */
    --ciyota-white: #ffffff;        /* Pure white */
    --ciyota-gray: #f8f9fa;         /* Light gray background */
    --ciyota-gray-dark: #6c757d;    /* Dark gray for text */
    --ciyota-text: #2c3e50;         /* Main text color */
    
    /* Status Colors */
    --ciyota-success: #27ae60;      /* Green for success */
    --ciyota-danger: #e74c3c;       /* Red for errors */
    --ciyota-warning: #ffc32c;      /* Yellow for warnings (using CIYOTA Yellow) */
    --ciyota-info: #10235e;         /* Navy for info (using CIYOTA Navy) */
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50%;
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--ciyota-white);
    color: var(--ciyota-text);
    line-height: 1.6;
    font-size: 1rem;
    overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--ciyota-navy);
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--ciyota-text);
}

a {
    color: var(--ciyota-navy);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--ciyota-yellow);
    text-decoration: underline;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--ciyota-navy);
    color: white;
}

.btn-primary:hover {
    background-color: var(--ciyota-navy-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--ciyota-yellow);
    color: var(--ciyota-navy);
}

.btn-secondary:hover {
    background-color: var(--ciyota-yellow-dark);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--ciyota-yellow);
    color: var(--ciyota-navy);
}

.btn-accent:hover {
    background-color: var(--ciyota-yellow-dark);
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--ciyota-success);
    color: white;
}

.btn-danger {
    background-color: var(--ciyota-danger);
    color: white;
}

.btn-outline-primary {
    background-color: transparent;
    border: 2px solid var(--ciyota-navy);
    color: var(--ciyota-navy);
}

.btn-outline-primary:hover {
    background-color: var(--ciyota-navy);
    color: white;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    transition: box-shadow var(--transition-normal);
    border: 1px solid #e0e0e0;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--ciyota-navy);
    padding: var(--spacing-md);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 2px solid var(--ciyota-yellow);
    font-weight: 600;
    color: white;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    background-color: var(--ciyota-gray);
    padding: var(--spacing-md);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    border-top: 1px solid #e0e0e0;
}

/* ============================================
   FORMS
   ============================================ */
.form-control {
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem;
    transition: border-color var(--transition-fast);
    font-family: 'Poppins', sans-serif;
}

.form-control:focus {
    border-color: var(--ciyota-yellow);
    box-shadow: 0 0 0 0.2rem rgba(255, 195, 44, 0.25);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--ciyota-text);
    margin-bottom: var(--spacing-sm);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   TABLES
   ============================================ */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, var(--ciyota-navy), var(--ciyota-navy-dark));
    color: white;
}

.table thead th {
    padding: var(--spacing-md);
    text-align: left;
    font-weight: 600;
}

.table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: rgba(255, 195, 44, 0.1);
}

.table tbody td {
    padding: var(--spacing-md);
}

.table tbody tr:last-child {
    border-bottom: none;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.alert-success {
    background-color: #d4edda;
    border-color: var(--ciyota-success);
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: var(--ciyota-danger);
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: var(--ciyota-warning);
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: var(--ciyota-info);
    color: #0c5460;
}

/* ============================================
   BADGES
   ============================================ */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-block;
}

.badge-primary {
    background-color: var(--ciyota-navy);
    color: white;
}

.badge-secondary {
    background-color: var(--ciyota-yellow);
    color: var(--ciyota-navy);
}

.badge-success {
    background-color: var(--ciyota-success);
    color: white;
}

.badge-danger {
    background-color: var(--ciyota-danger);
    color: white;
}

.badge-warning {
    background-color: var(--ciyota-warning);
    color: white;
}

.badge-info {
    background-color: var(--ciyota-info);
    color: white;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary { color: var(--ciyota-navy) !important; }
.text-secondary { color: var(--ciyota-yellow) !important; }
.text-accent { color: var(--ciyota-yellow) !important; }
.text-success { color: var(--ciyota-success) !important; }
.text-danger { color: var(--ciyota-danger) !important; }
.text-warning { color: var(--ciyota-warning) !important; }
.text-muted { color: var(--ciyota-gray-dark) !important; }

.bg-primary { background-color: var(--ciyota-navy) !important; }
.bg-secondary { background-color: var(--ciyota-yellow) !important; }
.bg-light { background-color: var(--ciyota-gray) !important; }
.bg-gray { background-color: var(--ciyota-gray) !important; }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
    border: 3px solid rgba(16, 35, 94, 0.1);
    border-top: 3px solid var(--ciyota-navy);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .card {
        padding: var(--spacing-md);
    }
    
    .table {
        font-size: 0.9rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: var(--spacing-sm);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white;
    }
    
    .no-print {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}