/* Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

:root {
    /* Base Variables (Light) */
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #f43f5e;
    --background-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --glass-border: #e2e8f0;
    --glass-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --sidebar-bg: #ffffff;
    --nav-hover: #f1f5f9;
    --code-bg: #f8fafc;
    --code-text: #1e293b;
    --radius: 8px;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-theme {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --background-color: #020617;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: #0f172a;
    --glass-border: #1e293b;
    --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --sidebar-bg: #030712;
    --nav-hover: #1e293b;
    --code-bg: #0f172a;
    --code-text: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    /* remove underline */
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* Core Panels */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-secondary {
    /* Pink/Magenta */
    background: var(--secondary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Layout */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}


.sidebar {
    width: 260px;
    flex-shrink: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 10;
    border-right: 1px solid var(--glass-border);
    background: var(--sidebar-bg);
}

.sidebar.glass-panel {
    border-radius: 0;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-logo img {
    width: 100%;
    height: auto;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    display: block;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-color);
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--nav-hover);
    color: var(--primary-color);
    font-weight: 500;
}

.main-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

/* Auth Centering */
.wrapper:has(.auth-wrapper) .sidebar {
    display: none !important;
}

.auth-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 100;
}


.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* .auth-wrapper moved above main-content for better visibility */





/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-color);
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Cards & Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

/* Prism Customization */
pre[class*="language-"] {
    background: var(--code-bg) !important;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

code[class*="language-"] {
    font-family: 'Fira Code', monospace !important;
    font-size: 0.95rem;
    color: var(--code-text) !important;
}

/* Very basic Prism light overrides if the theme doesn't switch automatically */
.token.comment {
    color: #64748b;
}

.token.string {
    color: #059669;
}

.token.keyword {
    color: #4f46e5;
}

.token.function {
    color: #8b5cf6;
}


/* Theme Toggle Icons */
.dark-theme .dark-icon {
    display: none !important;
}

.dark-theme .light-icon {
    display: block !important;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Auth Page Specific */
/* .auth-wrapper already defined above */


.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 3rem;
}

/* Blog */
.blog-post {
    margin-bottom: 3rem;
}

.blog-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.post-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Exam Interface */
.question-card {
    max-width: 800px;
    margin: 0 auto;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.option-label:hover,
.option-input:checked+.option-label {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

.option-input {
    display: none;
}

.timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 2rem;
}

/* Single-Line Filter Bar */
.filter-bar {
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.filter-bar .form-group-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.filter-bar .form-label {
    margin-bottom: 0;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
}

.filter-bar .form-select {
    padding: 0.6rem 2.25rem 0.6rem 1rem;
    border-radius: 12px;
    background-color: var(--background-color);
    border: 1px solid var(--glass-border);
    font-size: 0.95rem;
    min-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px 12px;
    transition: var(--transition);
}

.filter-bar .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-bar .btn-filter {
    padding: 0.6rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.filter-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}