/* ═══════════════════════════════════════════════════════════
   OU Results Mirror – Premium Dark Glassmorphic Design
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --glass-bg: rgba(18, 18, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-muted: #555577;
    --accent: #6c5ce7;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --accent-2: #00cec9;
    --success: #00b894;
    --danger: #ff7675;
    --warning: #fdcb6e;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Animated Background ── */
.bg-gradient {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(108, 92, 231, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 206, 201, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(108, 92, 231, 0.06) 0%, transparent 50%);
    z-index: 0;
    animation: bgShift 15s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0%   { opacity: 0.8; }
    50%  { opacity: 1; }
    100% { opacity: 0.8; }
}

.bg-particles {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px; height: 3px;
    background: rgba(108, 92, 231, 0.3);
    border-radius: 50%;
    animation: float linear infinite;
}

@keyframes float {
    0%   { transform: translateY(100vh) scale(0); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ── Glass Card ── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
}

/* ── Header ── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 24px;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.logo-sub {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
}

.stat-dot.live {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.4); }
    50%      { box-shadow: 0 0 0 6px rgba(0, 184, 148, 0); }
}

/* ── Main ── */
.main {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

/* ── Search Section ── */
.search-card {
    padding: 40px 36px;
    text-align: center;
}

.search-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #e8e8f0, var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.search-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 28px;
    line-height: 1.5;
}

.input-group {
    display: flex;
    gap: 10px;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    font-size: 16px;
    font-family: 'Inter', monospace;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.search-input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0;
    font-weight: 400;
    font-size: 14px;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-btn {
    background: linear-gradient(135deg, var(--accent), #5a4bd1);
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 110px;
}

.search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn.loading .btn-text { opacity: 0; }
.search-btn.loading .btn-loader { opacity: 1; }

.btn-loader {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    opacity: 0;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ── Error Box ── */
.error-box {
    margin-top: 20px;
    padding: 12px 18px;
    background: rgba(255, 118, 117, 0.1);
    border: 1px solid rgba(255, 118, 117, 0.2);
    border-radius: var(--radius-xs);
    color: var(--danger);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Results Cards ── */
.results-section {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    padding: 28px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--glass-border);
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.source-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.source-badge.cache {
    background: rgba(0, 206, 201, 0.15);
    color: var(--accent-2);
    border: 1px solid rgba(0, 206, 201, 0.2);
}

.source-badge.live {
    background: rgba(108, 92, 231, 0.15);
    color: var(--accent);
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.detail-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-value.highlight {
    color: var(--accent);
    font-family: 'Inter', monospace;
    letter-spacing: 1px;
}

/* ── Marks Table ── */
.table-wrapper {
    overflow-x: auto;
}

.marks-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.marks-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--glass-border);
}

.marks-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-weight: 500;
}

.marks-table tbody tr {
    transition: background 0.2s;
}

.marks-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}

.grade-cell {
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    min-width: 36px;
    text-align: center;
}

.grade-o    { background: rgba(0, 184, 148, 0.15); color: #00b894; }
.grade-aplus { background: rgba(0, 206, 201, 0.15); color: #00cec9; }
.grade-a    { background: rgba(108, 92, 231, 0.15); color: #a29bfe; }
.grade-bplus { background: rgba(253, 203, 110, 0.15); color: #fdcb6e; }
.grade-b    { background: rgba(253, 203, 110, 0.1); color: #e1b154; }
.grade-c    { background: rgba(255, 118, 117, 0.1); color: #fab1a0; }
.grade-d    { background: rgba(255, 118, 117, 0.15); color: #ff7675; }
.grade-f    { background: rgba(255, 71, 87, 0.2); color: #ff6b6b; }
.grade-ab   { background: rgba(255, 71, 87, 0.15); color: #ee5a24; }

/* ── Result Summary ── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: center;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.summary-value {
    font-size: 22px;
    font-weight: 800;
}

.summary-value.sgpa {
    color: var(--accent-2);
}

.summary-value.status.passed {
    color: var(--success);
}

.summary-value.status.failed {
    color: var(--danger);
}

/* ── Animations ── */
.fade-in {
    animation: fadeSlideUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Footer ── */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .search-card { padding: 28px 20px; }
    .search-title { font-size: 22px; }
    .input-group { flex-direction: column; }
    .search-btn { width: 100%; }
    .details-grid { grid-template-columns: 1fr 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .result-card { padding: 20px 16px; }
    .header-content { flex-direction: column; gap: 10px; }
}
