:root {
    --bg-color: #f8fafc; /* Very light slate */
    --surface-color: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb; /* Clean blue */
    --primary-hover: #1d4ed8;
    --border: #e2e8f0;
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background: var(--surface-color);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Loader */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: var(--text-muted);
}
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Subjects Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.subject-card {
    background: var(--surface-color);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.subject-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    border-color: #cbd5e1;
}

.subject-icon {
    font-size: 2rem;
    background: var(--bg-color);
    padding: 0.75rem;
    border-radius: 0.75rem;
}

.subject-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Modal */
.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 1rem;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface-color);
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 101;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(0.98);
    transition: transform 0.2s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    padding-right: 2rem;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--bg-color);
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}

.pyq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pyq-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.pyq-item:hover {
    border-color: var(--primary);
}

.pyq-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pyq-year {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.pyq-name {
    font-size: 0.875rem;
    color: var(--text-muted);
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pyq-action {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
}

/* Error */
.error {
    background: #fee2e2;
    color: #b91c1c;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid #f87171;
    text-align: center;
    margin: 2rem 0;
}

/* Footer */
.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border);
    padding: 2rem 1rem;
    margin-top: auto;
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.disclaimer {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #fffbeb; /* Light yellow */
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    color: #92400e;
}

.credits {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.credits a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.credits a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container { padding: 2rem 1rem; }
    .title { font-size: 2rem; }
}

@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}
