/* style.css - Finalized Responsive & Trendy UI */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #d81b60;       /* Vibrant Magenta */
    --primary-dark: #ad1457;  /* Darker Magenta */
    --secondary: #4a148c;     /* Deep Purple */
    --accent: #ff4081;        /* Bright Pink */
    --success: #00c853;       /* Emerald Green */
    --danger: #ff1744;        /* Bright Red */
    --dark: #1a1a2e;          /* Navy Black */
    --light: #f3f4f6;
    --white: #ffffff;
    --glass: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --gradient: linear-gradient(135deg, #d81b60 0%, #4a148c 100%);
}

body {
    font-family: 'Poppins', sans-serif;
    background: #fdf2f8; /* Very light pink background */
    margin: 0;
    padding: 0;
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* --- Cards & Glassmorphism --- */
.card {
    background: var(--white);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    border: 1px solid rgba(216, 27, 96, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(216, 27, 96, 0.15);
}

/* --- Headers --- */
.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
    background: var(--white);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

h2, h3 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-top: 0;
    letter-spacing: -0.5px;
}

/* NEW: Student ID Badge Style */
.student-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #fce4ec; /* Light Pink */
    color: var(--primary-dark);
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(216, 27, 96, 0.2);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-top: 5px;
}

/* --- Forms --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
    font-size: 0.9rem;
}

input, select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s;
    background: #f9f9f9;
}

input:focus, select:focus {
    border-color: var(--primary);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(216, 27, 96, 0.1);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.btn-primary { 
    background: var(--gradient); 
    color: white; 
}
.btn-primary:hover { 
    filter: brightness(1.1); 
    transform: translateY(-2px);
}

.btn-secondary { background: var(--dark); color: white; }
.btn-secondary:hover { background: #000; }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 8px 16px; font-size: 12px; }

/* --- Tables (Responsive) --- */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto; /* Horizontal scroll on mobile */
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    background: white;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Forces scroll on small screens */
}

.data-table th {
    background: var(--primary-dark);
    color: white;
    padding: 16px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    white-space: nowrap;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background-color: #fdf2f8; }

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; margin-top: 30px; gap: 8px; flex-wrap: wrap; }
.pagination a {
    padding: 10px 16px;
    background: white;
    border: 2px solid #eee;
    color: var(--dark);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: 0.2s;
}
.pagination a.active, .pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- Dashboard Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: var(--gradient);
    color: white;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(216, 27, 96, 0.3);
}
.stat-number { font-size: 2.5rem; font-weight: 700; display: block; }
.stat-label { font-size: 0.9rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 1px; }

/* --- Filters --- */
.filter-container {
    background: white;
    padding: 20px;
    border-radius: 16px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 25px;
}
.filter-group { flex: 1 1 200px; } /* Flex grow/shrink */
.search-group { flex: 2 1 300px; position: relative; }

.search-group input { border-radius: 50px; padding-left: 40px; }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--primary); }

/* --- Modals --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 26, 46, 0.8); z-index: 1000; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
    padding: 20px;
}
.modal-box {
    background: white; padding: 40px; border-radius: 20px; width: 100%; max-width: 400px;
    text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modal-actions { display: flex; justify-content: center; gap: 15px; margin-top: 25px; }

/* --- Student Dashboard Catalog (Finalized UI) --- */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    align-items: stretch;
    margin-top: 20px;
}

.course-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(216, 27, 96, 0.15);
    border-color: rgba(216, 27, 96, 0.2);
}

/* UPDATED: Course Header with Magenta Gradient + White Text */
.course-header {
    background: var(--gradient); /* Magenta Theme Gradient */
    padding: 20px;
    position: relative;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Force Header Title to be White */
.course-header h3 {
    color: white !important;
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.4;
    padding-right: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Force Header Code to be Transparent White */
.course-header small {
    color: rgba(255, 255, 255, 0.9) !important;
    margin-top: 5px;
    font-size: 0.85rem;
    display: block;
    font-weight: 500;
}

/* Updated Pill for Magenta Background */
.course-type {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(5px);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.course-body {
    padding: 25px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.grade-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 5px solid #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--dark);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.05);
}

.grade-circle.pass {
    border-color: var(--success);
    color: var(--success);
    background: #e8f5e9;
}

.grade-circle.fail {
    border-color: var(--danger);
    color: var(--danger);
    background: #ffebee;
}

.course-footer {
    padding: 15px 20px;
    background: #fafbfc;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
}

/* --- Loading Spinner --- */
.loading-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7); display: none; justify-content: center; align-items: center; z-index: 5;
}
.spinner {
    border: 3px solid #f3f3f3; border-top: 3px solid #3498db; border-radius: 50%;
    width: 20px; height: 20px; animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }


/* --- Mobile Responsive Tweaks --- */
@media (max-width: 768px) {
    .container { padding: 15px; }
    
    .nav-header { flex-direction: column; align-items: center; text-align: center; }
    .nav-header div { width: 100%; }
    .nav-header .btn { width: 100%; margin-top: 10px; justify-content: center; }
    
    /* Stack Filters */
    .filter-container { flex-direction: column; align-items: stretch; gap: 10px; }
    .filter-group, .search-group { width: 100%; flex: none; }
    
    /* Stack Form Inputs */
    .form-grid { grid-template-columns: 1fr; } 
    
    /* Stats grid: 1 column on very small screens */
    .stats-grid { grid-template-columns: 1fr; }
}

/* Standard Header (Courses) - Keeps Magenta */
.course-header {
    background: var(--gradient); 
}

/* NEW: Exam Header Variant (Deep Blue/Purple) */
.course-header.exam-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); /* Elegant Blue */
}

/* Lecturer Name Styling */
.lecturer-info {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid #eee;
}

/* --- Global Footer --- */
.site-footer {
    text-align: center;
    padding: 25px 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(216, 27, 96, 0.1); /* Subtle Magenta border */
    color: #777;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.footer-whatsapp {
    color: #25D366; /* Official WhatsApp Green */
    margin-left: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.footer-whatsapp:hover {
    color: #128C7E;
}

/* Fix for Login/Verify pages to center footer properly */
body.centered-view .site-footer {
    position: absolute;
    bottom: 10px;
    width: 100%;
    border-top: none;
}