:root {
    --brand-primary: #00f0ff; /* Vibrant teal accent */
    --brand-secondary: #7b2cbf; /* Deep purple */
    --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
    
    --bg-base: #0f172a; /* Deep navy base */
    --bg-card: rgba(30, 41, 59, 0.7); /* Semi-transparent card */
    --bg-glass: rgba(255, 255, 255, 0.05); /* Glass effect */
    
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-accent: var(--brand-primary);
    
    --border-light: rgba(255, 255, 255, 0.1);
    --border-accent: var(--brand-primary);
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(0, 240, 255, 0.3);
    
    --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', 'Roboto Mono', monospace;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 80% 0%, rgba(123, 44, 191, 0.15) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(0, 240, 255, 0.15) 0px, transparent 50%);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--text-accent);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    opacity: 0.8;
}



/* Header Styles */
header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 40px;
    width: auto;
    border-radius: 50%;
    object-fit: cover;
}

.dashboard-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

nav ul li a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 0.5rem 0;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--brand-gradient);
    transition: var(--transition-base);
}

nav ul li a:hover, 
nav ul li a.active {
    color: var(--text-primary);
}

nav ul li a:hover::after {
    width: 100%;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: var(--bg-card);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 1;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    padding: 0.5rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition-base);
}

.dropdown:hover .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
    margin: 0;
}

.dropdown-menu a {
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    display: block;
    transition: var(--transition-fast);
}

.dropdown-menu a:hover {
    background-color: rgba(0, 240, 255, 0.1);
    color: var(--text-primary);
}

/* Main Content */
main {
    padding: 2rem;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Welcome Section */
.welcome-section {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transition: var(--transition-base);
}

.welcome-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.welcome-section h2 {
    font-size: 1.8rem;
    color: var(--text-accent);
    margin-top: 0;
    font-weight: 600;
}

.welcome-section p {
    color: var(--text-secondary);
    margin: 0.75rem 0 0;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-box {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: var(--transition-base);
    text-align: center;
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.stat-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: var(--text-accent);
}

.stat-box p {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-box a {
    display: inline-block;
    background: var(--brand-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1rem;
    transition: var(--transition-fast);
}

.stat-box a:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Form Button Styles */
button[type="submit"] {
    background: var(--brand-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: 1rem;
}

button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Toggle Button Styles */
.visible-btn {
    background: var(--brand-primary);
    color: var(--bg-base);
}

.hidden-btn {
    background: var(--brand-secondary);
    color: white;
}

/* Results Section */
.recent-results {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.recent-results h2 {
    font-size: 1.8rem;
    color: var(--text-accent);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.75rem;
}

.recent-results h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--brand-gradient);
    border-radius: 2px;
}

/* Table Styles */
table {
    max-width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    margin-right:1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

table th, 
table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

table th {
    background: rgba(0, 240, 255, 0.1);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: var(--text-accent);
}

table tbody tr {
    transition: var(--transition-fast);
}

table tbody tr:hover {
    background: rgba(0, 240, 255, 0.05);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* Alert Styles */
.alert {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 4px solid transparent;
    transition: var(--transition-base);
}

.alert:hover {
    transform: translateX(2px);
}

.alert-warning {
    background: rgba(255, 196, 0, 0.1);
    color: #ffc400;
    border-left-color: #ffc400;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left-color: #dc3545;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border-left-color: #28a745;
}

/* Alert Box Styles */
#alertBox {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin: 1rem 0;
    display: none;
}

#alertBox.success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border-left: 4px solid #28a745;
}

#alertBox.error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

#errorDownload {
    margin-top: 1rem;
}

#errorLink {
    color: var(--text-accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

#errorLink:hover {
    text-decoration: underline;
}

/* Form Styling */
#resultUploadForm {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

#resultUploadForm label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

#resultUploadForm select,
#resultUploadForm input[type="file"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: 1rem;
}

#resultUploadForm select:focus,
#resultUploadForm input[type="file"]:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.2);
}

/* Recent Uploads Section */
.recent-uploads {
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    margin-top: 2rem;
}

.recent-uploads h2 {
    font-size: 1.8rem;
    color: var(--text-accent);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.75rem;
}

.recent-uploads h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--brand-gradient);
    border-radius: 2px;
}

.view-more-btn {
    display: inline-block;
    margin-top: 1rem;
    background: var(--brand-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition-fast);
}

.view-more-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Footer */
footer {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

/* Grade Colors */
.grade-a { color: #00ffaa; }
.grade-b { color: #50ff7b; }
.grade-c { color: #a0ff50; }
.grade-d { color: #f6ad55; }
.grade-e { color: #ff7b50; }
.grade-f, .grade-nr, .grade-abs { color: #ff5050; }

/* Button Styles */
.view-btn, .view-more-btn, .back-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: white;
    background: var(--brand-gradient);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    margin: 0.25rem;
}

.view-btn:hover, 
.view-more-btn:hover, 
.back-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-success {
    background-color: rgba(0, 255, 170, 0.1);
    color: #00ffaa;
    border: 1px solid rgba(0, 255, 170, 0.3);
}

.badge-warning {
    background-color: rgba(255, 196, 0, 0.1);
    color: #ffc400;
    border: 1px solid rgba(255, 196, 0, 0.3);
}

.badge-danger {
    background-color: rgba(255, 80, 80, 0.1);
    color: #ff5050;
    border: 1px solid rgba(255, 80, 80, 0.3);
}

/* Form Group Styles */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: #038094;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.2);
}

.form-control::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2300f0ff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-control-file {
    width: 100%;
    padding: 0.75rem 0;
}

/* File Input Custom Styling */
.form-control-file::-webkit-file-upload-button {
    visibility: hidden;
    width: 0;
    padding: 0;
}

.form-control-file::before {
    content: 'Choose File';
    display: inline-block;
    background: var(--brand-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-right: 1rem;
}

.form-control-file:hover::before {
    opacity: 0.9;
    transform: translateY(-1px);
}

.form-control-file:active::before {
    transform: translateY(0);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary {
    background: var(--brand-gradient);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1rem;
        text-align: center;
    }

    .logo-container {
        width: 100%;
        justify-content: center;
        margin-bottom: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
        text-align: center;
    }

    main {
        padding: 1rem;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    table th, 
    table td {
        padding: 0.5rem;
    }
    
    /* Dropdown menu adjustments */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background-color: transparent;
    }
    
    .dropdown:hover .dropdown-menu {
        display: none;
    }
    
    .dropdown-menu.show {
        display: block;
        opacity: 1;
        transform: none;
    }
    
    #resultUploadForm {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        height: 36px;
    }

    .dashboard-title {
        font-size: 1.3rem;
    }

    .welcome-section h2,
    .recent-results h2 {
        font-size: 1.5rem;
    }

    .stat-box p {
        font-size: 1.75rem;
    }
    
    .stat-box {
        padding: 1rem;
    }
    
    .view-btn, .view-more-btn, button[type="submit"] {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Report Generation Form Styles */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.container h2 {
    font-size: 1.8rem;
    color: var(--text-accent);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.container h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--brand-gradient);
    border-radius: 2px;
}

/* Form Styles */
form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

select, input[type="text"], input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: #02929c;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

select:focus, input[type="text"]:focus, input[type="number"]:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.2);
}

/* Radio Button Styles */
.radio-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radio-option input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 50%;
    transition: var(--transition-fast);
    position: relative;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked {
    border-color: var(--brand-primary);
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--brand-primary);
    border-radius: 50%;
}

.radio-option label {
    margin-bottom: 0;
    cursor: pointer;
    color: var(--text-secondary);
}

.radio-option input[type="radio"]:checked + label {
    color: var(--text-primary);
}

/* Submit Button Styles */
button[type="submit"] {
    grid-column: 1 / -1;
    background: var(--brand-gradient);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    margin-top: 1rem;
    justify-self: center;
    min-width: 200px;
}

button[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Alert Styles */
.alert {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 4px solid transparent;
    transition: var(--transition-base);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left-color: #dc3545;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    form {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .container h2 {
        font-size: 1.5rem;
    }
    
    button[type="submit"] {
        width: 100%;
    }
}