@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0a0f1d;
    --bg-secondary: #141c2f;
    --card-bg: rgba(20, 28, 47, 0.75);
    --accent-color: #3b82f6;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    --success-color: #10b981;
    --error-color: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(29, 78, 216, 0.1) 0px, transparent 50%);
}

header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(10, 15, 29, 0.8);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(to right, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
    letter-spacing: -0.5px;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Glassmorphic Card styles */
.search-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.search-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: -0.5px;
}

.search-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
    margin-bottom: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 0.5rem;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error-color);
}

/* Result Sheet Specific Styles */
.result-wrapper {
    max-width: 1000px;
    width: 100%;
    margin: 2rem auto;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

.result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.15);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.marksheet-card {
    background-color: #fff;
    color: #333;
    padding: 3rem;
    border-radius: 0 0 24px 24px;
    font-family: 'Outfit', 'Arial', sans-serif;
    position: relative;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.02);
}

.marksheet-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.university-logo {
    height: 70px !important;
    width: auto !important;
    object-fit: contain !important;
    margin-bottom: 0.75rem;
}

.marksheet-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.marksheet-header p {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.25rem;
}

.marksheet-header .memo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    margin-top: 0.75rem;
    letter-spacing: 1.5px;
    border-top: 1px dashed #777;
    border-bottom: 1px dashed #777;
    padding: 0.25rem 0;
}

.marksheet-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 2rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.meta-row {
    display: flex;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
}

.meta-label {
    font-weight: 600;
    color: #444;
    width: 180px;
    flex-shrink: 0;
}

.meta-value {
    color: #111;
    font-weight: 500;
}

/* Marksheet Table Styling to match physical layout precisely */
.marks-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.marks-table th, .marks-table td {
    border: 1px solid #333;
    padding: 0.5rem 0.75rem;
    text-align: center;
}

.marks-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #111;
}

.marks-table td.text-left {
    text-align: left;
}

.grand-total-row {
    font-weight: 700;
    background-color: #f1f5f9;
}

.grand-total-row td {
    border-top: 2px solid #333;
    font-weight: 700;
}

.status-footer {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid #333;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    background-color: #fafafa;
}

.marksheet-footer-notes {
    font-size: 0.75rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.notes-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.stamp-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 2rem;
    padding-right: 2rem;
    position: relative;
}

.stamp-image {
    width: 110px;
    height: 110px;
    opacity: 0.85;
}

/* Footer info */
footer {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* Print Styling */
@page {
    size: A4 portrait;
    margin: 10mm;
}
@media print {
    body {
        background: white !important;
        color: black !important;
        background-image: none !important;
    }
    header, footer, .result-actions, .nav-container, .term-switcher {
        display: none !important;
    }
    .result-wrapper {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .marksheet-card, .bu-card {
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: white !important;
        border: none !important;
    }
    .bu-table th, .bu-result-status {
        background-color: #f1f5f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Fix select option color visibility in dark backgrounds */
select option {
    background-color: #141c2f;
    color: #f3f4f6;
}

