:root {
    --bg: #020617;              /* Deep Dark Background */
    --card: rgba(255, 255, 255, 0.03);
    --accent: #fc4243;          /* Main Red Color */
    --secondary: #fbbf24;       /* Golden Yellow for Highlights */
    --text: #ffffff;            /* Pure White Text */
    --text-dim: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(252, 66, 67, 0.1); /* Subtle Red Glass effect */
}

/* --- Reset --- */
* { 
    margin: 0; padding: 0; box-sizing: border-box; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
}

/* Underline අයින් කරන ප්‍රධාන කොටස */
a { text-decoration: none; color: inherit; }

body { 
    background: var(--bg);
    /* Subtle Red glow ekak damma top corner ekata */
    background-image: radial-gradient(circle at top right, #ff4d4d26, var(--bg));
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Navigation --- */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 8%; border-bottom: 1px solid var(--border);
    backdrop-filter: blur(15px); position: sticky; top: 0; z-index: 1000;
}

.logo { font-weight: 800; font-size: 1.4rem; color: white; }
.logo span { color: var(--accent); }

/* --- Layout --- */
.container { 
    width: 90%; max-width: 600px; margin: 50px auto; text-align: center;
}

/* Vertical Grid (Desktop/Mobile දෙකටම එක යට එක) */
.grid {
    display: flex; flex-direction: column; gap: 15px; margin-top: 30px;
}

/* --- Premium Card (Glass Look) --- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-radius: 20px; padding: 25px;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: block; cursor: pointer;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.card h3 { font-size: 1.5rem; color: white; margin: 5px 0; }
.card p { color: var(--accent); font-weight: bold; font-size: 0.8rem; text-transform: uppercase; }

/* --- Buttons & Inputs --- */
/* --- Buttons --- */
.btn {
    background: var(--accent); 
    color: white;
    padding: 12px 28px; border-radius: 14px; border: none;
    font-weight: 700; cursor: pointer; 
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(252, 66, 67, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 12px rgba(252, 66, 67, 0.4);
    background: #ff5253; /* Slightly brighter red on hover */
}

.btn2 {
    background: var(--accent); 
    color: white;
    padding: 12px 28px; border-radius: 14px; border: none;
    font-weight: 700; cursor: pointer; 
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(66, 66, 252, 0.3);
}

.btn2:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 12px rgba(66, 66, 252, 0.3);
    background: #527aff; /* Slightly brighter red on hover */
}
.btn3 {
    background: var(--accent); 
    color: white;
    padding: 12px 28px; border-radius: 14px; border: none;
    font-weight: 700; cursor: pointer; 
    display: inline-block;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(66, 252, 202, 0.3);
}

.btn3:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 12px rgba(66, 66, 252, 0.3);
    background: #527aff; /* Slightly brighter red on hover */
}
input {
    width: 100%; background: var(--card); border: 1px solid var(--border);
    padding: 15px; border-radius: 12px; color: white; outline: none;
}

@media (max-width: 768px) {
    nav { padding: 15px 5%; }
}
/* --- Results Page Specific Tabs --- */
.tab {
    flex: 1;
    background: var(--card);
    border: 1px solid var(--border);
    padding: 12px;
    color: var(--text-dim);
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.tab.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

/* Underline Fix for all links */
a {
    text-decoration: none !important;
}

/* Grid adjustment for Results */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr !important;
    }
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.8); /* Dark background */
    backdrop-filter: blur(8px); /* පිටුපස Blur කරන කොටස */
    display: none; /* මුලින් පේන්නේ නැහැ */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: 0.3s;
}

.modal-card {
    background: #1e293b;
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: 0.3s;
}

.modal-overlay.active { display: flex; }
.modal-overlay.active .modal-card { transform: scale(1); }

.modal-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.m-btn {
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

.btn-edit { background: var(--accent); color: white; }
.btn-removee { background: #fbbf24; color: white; }
.btn-remove { background: #ef4444; color: white; }
.btn-cancel { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
/* --- Results Page Fix (Copy this to the bottom of style.css) --- */

/* Tabs lassanata yellow wenna */
.tab {
    background: rgba(2, 6, 23, 0.4) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

.tab.active {
    background: #fbbf24 !important; /* Yellow for active tab */
    color: #020617 !important;      /* Dark text */
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.3);
}

/* Table Headers සහ Marks yellow wenna */
/* Table Headers with specific color #94a3b8 */
th {
    color: #94a3b8 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Data tika yellow widiyatama thiyanna */
td {
    color: #fbbf24 !important;
}

/* Graph labels etc. highlight wenna */
.highlight-text {
    color: #fbbf24 !important;
}

/* --- Table Data Text Yellow Fix --- */

/* Table Headers with specific color #94a3b8 */
th {
    color: #94a3b8 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Data tika yellow widiyatama thiyanna */
td {
    color: #fbbf24 !important;
}

/* Table row eka hover karaddi thawa poddak bright wenna */
tr:hover td {
    color: #ffffff !important;
    background: rgba(251, 191, 36, 0.1);
}

/* Results labels (Batch, Exam name) yellow karanna */
.result-header h2, .result-header p {
    color: #fbbf24 !important;
}
/* --- Results Table Style Fix ONLY --- */

/* Table headers tika witharak #94a3b8 karanna */
th {
    color: #94a3b8 !important;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Table eke thiyena data (Index, Name, Marks) okkoma lassanata yellow karanna */
td, td * {
    color: #fbbf24 !important;
    font-weight: 500;
}

/* Table eke border eka thawa poddak soft karanna */
table {
    border-collapse: collapse;
    width: 100%;
}

td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
/* --- Admin Panel: Modal Edit Button Only --- */

.m-btn.btn-edit {
    background: #fbbf24 !important; /* Yellow background */
    color: #020617 !important;      /* Dark text for better contrast */
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3) !important;
}

.m-btn.btn-edit:hover {
    background: #fcd34d !important; /* Slightly brighter on hover */
    transform: scale(1.02);
}
/* --- Global Mobile Text Spacing Fix --- */
@media (max-width: 768px) {
    /* Header labels සහ ඔක්කොම ලොකු අකුරු වල පරතරය අඩු කිරීමට */
    h1, h2, h3, .container h1, .container h1 span {
        line-height: 0.9 !important; /* පේළි අතර ඉඩ සම්පූර්ණයෙන්ම අඩු කළා */
        margin-top: 5px !important;
        margin-bottom: 10px !important;
        display: inline-block !important; /* Inline-block දැම්මම පරතරය පාලනය ලේසියි */
    }

    /* "Select Your Location" වගේ ඒවයේ වචන දෙක ලඟට ගැනීමට */
    .container header, .container {
        padding-top: 10px !important;
    }
}
/* Smooth Page Fade-in Animation */
@keyframes fadeInPage {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

body {
    animation: fadeInPage 0.5s ease-out forwards; /* Page eka load weddi smooth wenawa */
}