: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(209, 66, 252, 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 5%;
    position: sticky;
    top: 0;
    z-index: 1000;

    /* පසුබිම 90% ක් තද වර්ණයෙන් (Opacity 0.9) */
    background: rgba(2, 6, 23, 0.94); 
    
    /* කලින් තිබ්බ gradient එකත් එක්කම glass effect එක දීම */
    background-image: radial-gradient(circle at top right, rgba(255, 77, 77, 0.15), rgba(2, 6, 23, 0.9));

    /* යට තියෙන දේවල් බොඳ කරන ප්‍රමාණය (Blur effect) */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    /* වෙන් කර හඳුනා ගැනීමට යටින් සියුම් ඉරක් */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo { font-weight: 800; font-size: 1.4rem; color: white; }
.logo span { color: var(--accent); }

/* --- Layout --- */
.container { 
    width: 90%; max-width: 600px; margin: 30px auto; text-align: center;
}

/* Vertical Grid (Desktop/Mobile දෙකටම එක යට එක) */
.grid {
    display: flex; flex-direction: column; gap: 15px; margin-top: 30px;
}

/* --- High-End Glassmorphism & Blur --- */

/* Meka thamai page eke content blur karana main class eka */
.content-wrapper {
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.content-blur {
    filter: blur(5px) brightness(0.6) !important; /* Blur eka lassanata penna */
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: 0.3s ease;
    text-decoration: none;
    display: block;
    color: var(--dark);
}

.card:hover { 
    border-color: var(--accent); 
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.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: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    display: flex !important;
    opacity: 1;
}
.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 {
   
}

/* 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.container h1, .container h1 span {
        line-height: 0.6 !important; /* පේළි අතර ඉඩ සම්පූර්ණයෙන්ම අඩු කළා */
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        display: inline-block !important; /* Inline-block දැම්මම පරතරය පාලනය ලේසියි */
    }
    h2, h3{
        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 */
}

/* සර්ගේ ෆොටෝ එක රවුම් කරන්න සහ Glow එකක් දාන්න */
.profile-container {
    margin-bottom: 20px; /* Text එකට තියෙන පරතරය */
    display: flex;
    justify-content: center;
    animation: fadeIn 1.2s ease; /* ලස්සනට පේන්න */
}

.profile-img {
    width: 150px;  /* සයිස් එක මෙතනින් වෙනස් කරන්න පුළුවන් */
    height: 150px;
    border-radius: 100%; /* රවුම් වෙන්න */
    object-fit: cover;
    border: 3px solid var(--accent); /* රතු පාට බෝඩර් එක */
    box-shadow: 0 0 25px rgba(252, 66, 67, 0.4); /* Glow effect එක */
    transition: 0.4s ease;
}

/* Mouse එක ගෙනිච්චම පොඩ්ඩක් සූම් වෙන්න */
.profile-img:hover {
    transform: scale(1.10);
    box-shadow: 0 0 35px rgba(252, 66, 67, 0.6);
}
