/* ========================================
   FIPS MODERN DESIGN SYSTEM
   System-wide modern UI components and styling
   ======================================== */

:root {
    /* Brand Colors */
    --festari-deep-green: #0a3814;
    --festari-green: #0a2e13;
    --festari-green-light: #2d7040;
    --festari-gold: #d4af37;
    --festari-gold-light: #e6c547;
    --festari-gold-dark: #b8941f;
    
    /* Neutral Colors */
    --white: #ffffff;
    --black: #1a1a1a;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    
    /* Grading Colors */
    --grade-a: #18b8ad;      /* A >=80 - Teal (admin grid) */
    --grade-b: #091382;      /* B >=70 - Deep Blue */
    --grade-c: #8a03c0;      /* C >=60 - Purple */
    --grade-d: #bf740c;      /* D >=50 - Orange/Brown */
    --grade-f: #e60303;      /* F <50 - Red */
    
    /* Student Portal Specific */
    --student-primary: #2d5a27;
    --student-secondary: #4a7c59;
    --student-accent: #6f9e6b;
    --student-dark: #1a3d1a;
    --student-light: #f0f7f0;
    
    /* Student Portal Components */
    --student-card-bg: #ffffff;
    --student-card-shadow: 0 2px 8px rgba(45, 90, 39, 0.1);
    --student-card-hover-shadow: 0 4px 16px rgba(45, 90, 39, 0.15);
    --student-border: #e8f5e8;
    --student-text-primary: #2d3748;
    --student-text-secondary: #718096;
    --student-text-muted: #a0aec0;
    
    /* Student Button Variants */
    --student-btn-primary: var(--student-primary);
    --student-btn-primary-hover: #1e3d1e;
    --student-btn-outline: var(--student-primary);
    --student-btn-outline-hover: var(--student-light);
    
    /* Student Status Colors */
    --student-status-active: #28a745;
    --student-status-completed: #17a2b8;
    --student-status-pending: #ffc107;
    --student-status-failed: #dc3545;
    --student-status-available: #6f42c1;
    
    /* Shadows */
    --shadow-light: rgba(0,0,0,0.1);
    --shadow-medium: rgba(0,0,0,0.15);
    --shadow-heavy: rgba(0,0,0,0.25);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 15px;
    --radius-xl: 20px;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* ========================================
   BASE STYLES
   ======================================== */

body {
    background: linear-gradient(135deg, #f0f8f0 0%, #f8f9fa 50%, #e8f5e8 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ========================================
   MODERN CARDS
   ======================================== */

.modern-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 30px var(--shadow-light);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    margin-bottom: var(--space-lg);
}

.modern-card-header {
    background: linear-gradient(135deg, var(--festari-deep-green) 0%, var(--festari-green-light) 100%);
    color: var(--white);
    padding: var(--space-xl);
    position: relative;
    overflow: hidden;
}

.modern-card-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.modern-card-body {
    padding: var(--space-xl);
}

.modern-card-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.modern-card-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ========================================
   MODERN TABLES
   ======================================== */

.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow-light);
}

.modern-table thead th {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-200) 100%);
    border: none;
    padding: var(--space-md) var(--space-lg);
    font-weight: 700;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    color: var(--gray-600);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-table tbody td {
    border: none;
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    vertical-align: middle;
    transition: all 0.3s ease;
}

.modern-table tbody tr:hover td {
    background-color: var(--gray-50);
    transform: translateY(-1px);
}

/* ========================================
   MODERN BUTTONS
   ======================================== */

.modern-btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: var(--space-lg) var(--space-xl);
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 8px var(--shadow-light);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
}

.modern-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow-medium);
    text-decoration: none;
}

.modern-btn-primary {
    background: linear-gradient(135deg, var(--festari-deep-green) 0%, var(--festari-green-light) 100%);
    color: var(--white);
}

.modern-btn-secondary {
    background: linear-gradient(135deg, var(--gray-500) 0%, var(--gray-600) 100%);
    color: var(--white);
}

.modern-btn-outline {
    background: rgba(255,255,255,0.9);
    color: var(--festari-deep-green);
    border: 2px solid var(--festari-deep-green);
}

.modern-btn-outline:hover {
    background: var(--festari-deep-green);
    color: var(--white);
}

.modern-btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: var(--white);
}

.modern-btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
    color: var(--white);
}

.modern-btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%);
    color: var(--white);
}

.modern-btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: var(--white);
}

/* ========================================
   GRADE BADGES
   ======================================== */

.grade-badge {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
    color: var(--white);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    box-shadow: 0 4px 8px var(--shadow-medium);
    transition: all 0.3s ease;
}

.grade-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--shadow-heavy);
}

.grade-badge-a {
    background-color: var(--grade-a);
}

.grade-badge-b {
    background-color: var(--grade-b);
}

.grade-badge-c {
    background-color: var(--grade-c);
}

.grade-badge-d {
    background-color: var(--grade-d);
}

.grade-badge-f {
    background-color: var(--grade-f);
}

/* ========================================
   STATS CARDS
   ======================================== */

.stats-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: 0 4px 12px var(--shadow-light);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    text-align: center;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-medium);
}

.stats-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    margin: 0 auto var(--space-md);
}

.stats-text {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}

.stats-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-600);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.modern-form-control {
    border-radius: var(--radius-md);
    border: 2px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-800);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: var(--space-lg);
    font-size: 14px;
}

.modern-form-control:focus {
    border-color: var(--festari-deep-green);
    box-shadow: 0 0 0 0.2rem rgba(10, 56, 20, 0.25);
    outline: none;
    background: var(--white);
    transform: translateY(-2px);
}

.modern-form-control::placeholder {
    color: var(--gray-500);
}

/* ========================================
   PAGE HEADERS
   ======================================== */

.page-header {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: 0 4px 12px var(--shadow-light);
    border: 1px solid rgba(255,255,255,0.2);
}

.page-header h1,
.page-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: var(--space-sm);
}

.page-header p {
    color: var(--gray-500);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* ========================================
   STUDENT CARDS
   ======================================== */

.student-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px var(--shadow-light);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.student-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow-medium);
}

.student-header {
    background: linear-gradient(135deg, #f8f8f8 0%, #f7f7f7 100%);
    padding: var(--space-xl);
    border-bottom: 1px solid var(--gray-200);
}

.student-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--festari-deep-green);
    margin-bottom: var(--space-sm);
}

.student-id {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-sm); }
.mb-3 { margin-bottom: var(--space-md); }
.mb-4 { margin-bottom: var(--space-lg); }
.mb-5 { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-sm); }
.mt-3 { margin-top: var(--space-md); }
.mt-4 { margin-top: var(--space-lg); }
.mt-5 { margin-top: var(--space-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-xs); }
.p-2 { padding: var(--space-sm); }
.p-3 { padding: var(--space-md); }
.p-4 { padding: var(--space-lg); }
.p-5 { padding: var(--space-xl); }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .modern-card-header,
    .modern-card-body {
        padding: var(--space-lg);
    }
    
    .modern-table thead th,
    .modern-table tbody td {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
    }
    
    .modern-btn {
        padding: var(--space-md) var(--space-lg);
        font-size: 0.9rem;
    }
    
    .stats-card {
        padding: var(--space-lg);
    }
    
    .stats-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */

.modern-scroll::-webkit-scrollbar {
    width: 8px;
}

.modern-scroll::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

.modern-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--festari-deep-green) 0%, var(--festari-green-light) 100%);
    border-radius: 10px;
}

/* ========================================
   LOADING STATES
   ======================================== */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--radius-xl);
}

/* ========================================
   ALERTS AND NOTIFICATIONS
   ======================================== */

.modern-alert {
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    border: none;
    font-weight: 500;
}

.modern-alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.modern-alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.modern-alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.modern-alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* ========================================
   STUDENT PORTAL COMPONENTS
   ======================================== */

/* Student Button Variants */
.btn-student {
    background: var(--student-primary);
    border-color: var(--student-primary);
    color: white;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn-student:hover {
    background: var(--student-btn-primary-hover);
    border-color: var(--student-btn-primary-hover);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--student-card-hover-shadow);
}

.btn-student-outline {
    background: transparent;
    border-color: var(--student-btn-outline);
    color: var(--student-btn-outline);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.btn-student-outline:hover {
    background: var(--student-btn-outline-hover);
    border-color: var(--student-primary);
    color: var(--student-primary);
    transform: translateY(-1px);
    box-shadow: var(--student-card-shadow);
}

/* Student Cards */
.student-card {
    background: var(--student-card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--student-card-shadow);
    border: 1px solid var(--student-border);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

.student-card-header {
    background: linear-gradient(135deg, var(--student-primary) 0%, var(--student-secondary) 100%);
    color: white;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--student-border);
}

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

.student-card-footer {
    background: var(--student-light);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--student-border);
}

/* Student Status Badges */
.student-status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.student-status-active {
    background-color: var(--student-status-active);
    color: white;
}

.student-status-completed {
    background-color: var(--student-status-completed);
    color: white;
}

.student-status-pending {
    background-color: var(--student-status-pending);
    color: var(--student-dark);
}

.student-status-failed {
    background-color: var(--student-status-failed);
    color: white;
}

.student-status-available {
    background-color: var(--student-status-available);
    color: white;
}

/* Student Progress Bars */
.student-progress {
    height: 8px;
    border-radius: var(--radius-sm);
    background: var(--student-light);
    overflow: hidden;
}

.student-progress-bar {
    background: linear-gradient(90deg, var(--student-primary), var(--student-secondary));
    height: 100%;
    transition: width 0.6s ease;
    border-radius: var(--radius-sm);
}

/* Student Navigation */
.student-nav-link {
    color: var(--student-text-secondary);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.student-nav-link:hover {
    color: var(--student-primary);
    background: var(--student-light);
    text-decoration: none;
}

.student-nav-link.active {
    color: var(--student-primary);
    background: var(--student-light);
    font-weight: 600;
}

/* Student Form Elements */
.student-form-control:focus {
    border-color: var(--student-primary);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.student-form-check-input:checked {
    background-color: var(--student-primary);
    border-color: var(--student-primary);
}

/* Student Tables */
.student-table {
    background: var(--student-card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--student-card-shadow);
}

.student-table th {
    background: var(--student-light);
    color: var(--student-text-primary);
    font-weight: 600;
    padding: 1rem;
    border-bottom: 2px solid var(--student-border);
}

.student-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--student-border);
    color: var(--student-text-secondary);
}

.student-table tbody tr:hover {
    background: var(--student-light);
}

/* Student Stats Cards */
.student-stat-card {
    background: var(--student-card-bg);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    box-shadow: var(--student-card-shadow);
    border-left: 4px solid var(--student-primary);
    transition: all 0.3s ease;
}

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

.student-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--student-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.student-stat-label {
    font-size: 0.875rem;
    color: var(--student-text-secondary);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .student-card-body {
        padding: var(--space-md);
    }
    
    .student-stat-value {
        font-size: 1.5rem;
    }
    
    .btn-student,
    .btn-student-outline {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
}
