/* style.css - Shared Design System for Shubho Sir's Physics Classes Student Portal */

:root {
    --bg-color: #080c14;
    --card-bg: rgba(13, 18, 30, 0.75);
    --card-hover-bg: rgba(17, 24, 39, 0.85);
    --primary-glow: #10b981; /* Emerald green */
    --secondary-glow: #3b82f6; /* Blue */
    --text-color: #f3f4f6;
    --text-muted: #9ca3af;
    --text-soft: #d1d5db;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --math-color: #f59e0b;
    --physics-color: #ec4899;
    --chemistry-color: #a855f7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Ambient Glow Backgrounds */
.ambient-glow::before, .ambient-glow::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(160px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
}

.ambient-glow::before {
    top: 10%;
    left: 8%;
    background-color: var(--primary-glow);
}

.ambient-glow::after {
    bottom: 12%;
    right: 8%;
    background-color: var(--secondary-glow);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0b0f19;
}

::-webkit-scrollbar-thumb {
    background: #1f2937;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #374151;
}

/* --- Layout Components --- */

/* Sticky Top Navbar */
.navbar {
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(8, 12, 20, 0.85);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.logo-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-glow);
}

/* Navigation button styles */
.btn-nav {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-color);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.btn-logout-nav {
    border-color: rgba(239, 68, 68, 0.15);
}

.btn-logout-nav:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--error-color);
}

/* Main Cards */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.4);
}

/* Main Buttons */
.btn-primary {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.975rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
    filter: brightness(1.08);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #1f2937;
    color: #4b5563;
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid var(--border-color);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.75px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: rgba(156, 163, 175, 0.4);
}

.form-input:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

/* Show/Hide password toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-color);
}

/* Custom Checkbox/Radio Option Cards */
.radio-option, .checkbox-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.015);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.radio-option:hover, .checkbox-option:hover {
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(255, 255, 255, 0.15);
}

.radio-option input[type="radio"], .checkbox-option input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    accent-color: var(--primary-glow);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.radio-option.selected, .checkbox-option.selected {
    border-color: var(--primary-glow);
    background: rgba(16, 185, 129, 0.04);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.05);
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-title {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95rem;
}

.option-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

.alert-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.alert-success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Badges */
.badge {
    font-size: 0.725rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-muted {
    background: rgba(156, 163, 175, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(156, 163, 175, 0.15);
}

.badge-new-flash {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.15);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    animation: flash-pulse 1.8s infinite alternate;
}

@keyframes flash-pulse {
    0% {
        opacity: 0.6;
        box-shadow: 0 0 2px rgba(251, 191, 36, 0.1);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
    }
}

/* Accordions */
.accordion-item {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.open-item {
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 8px 30px rgba(16, 185, 129, 0.04);
}

.accordion-header {
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.015);
}

.accordion-header-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    flex-wrap: wrap;
}

.accordion-header-title svg {
    color: var(--primary-glow);
    opacity: 0.85;
    transition: transform 0.2s ease;
}

.accordion-chevron {
    color: var(--text-muted);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.accordion-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-content.open {
    grid-template-rows: 1fr;
}

.accordion-inner {
    overflow: hidden;
    padding: 0 28px;
    transition: padding 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.accordion-content.open .accordion-inner {
    padding: 0 28px 28px 28px;
}

/* Accordion Header Previews */
.accordion-header-preview {
    font-size: 0.825rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: auto;
    margin-right: 12px;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.25s ease;
}

.accordion-item.open-item .accordion-header-preview {
    opacity: 0;
    pointer-events: none;
}

/* Empty States */
.empty-state {
    padding: 40px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px dashed var(--border-color);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.005);
}

.empty-state-icon {
    color: var(--text-muted);
    opacity: 0.45;
    margin-bottom: 4px;
}

.empty-state-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
}

.empty-state-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 320px;
    line-height: 1.4;
}

/* Responsive Table utilities */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.marks-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.marks-table th, .marks-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.marks-table th {
    background: rgba(255, 255, 255, 0.015);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.775rem;
    letter-spacing: 0.5px;
}

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

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

/* Stacking layouts on mobile instead of horizontal tables */
.mobile-card-grid {
    display: none;
}

@media (max-width: 768px) {
    .table-responsive {
        display: none; /* Hide standard wide table */
    }
    .mobile-card-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }
    .mobile-row-card {
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid var(--border-color);
        border-radius: 14px;
        padding: 16px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        padding-bottom: 8px;
    }
    .mobile-card-title {
        font-weight: 600;
        color: #ffffff;
        font-size: 0.95rem;
    }
    .mobile-card-body {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        font-size: 0.85rem;
    }
    .mobile-field {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .mobile-field-label {
        font-size: 0.725rem;
        color: var(--text-muted);
        text-transform: uppercase;
    }
    .mobile-field-value {
        font-weight: 500;
        color: #ffffff;
    }
}

/* --- Academic Performance Tabs --- */
.perf-tabs-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.perf-tabs-list {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.perf-tabs-list::-webkit-scrollbar {
    height: 4px;
}

.perf-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.perf-tab-btn:hover {
    color: var(--text-color);
}

.perf-tab-btn.active {
    color: var(--primary-glow);
    border-bottom-color: var(--primary-glow);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.perf-tab-panel {
    display: none;
}

.perf-tab-panel.active {
    display: block;
    animation: fadeInTab 0.35s ease;
}

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

