:root {
    --bg-color: #0d0f14;
    --card-bg: rgba(23, 27, 34, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.dark-theme {
    background: radial-gradient(circle at top right, #1e1b4b, #0d0f14);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px border var(--border-color);
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-bg);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--warning);
    box-shadow: 0 0 10px var(--warning);
}

.status-badge.online .dot {
    background-color: var(--success);
    box-shadow: 0 0 10px var(--success);
}

main {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input, select, textarea {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
}

/* Toggle Switch */
.toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.slider {
    width: 44px;
    height: 24px;
    background: #334155;
    border-radius: 24px;
    position: relative;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.primary-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
}

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

.shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { left: 100%; }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

#progress-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    margin-left: 2rem;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    flex: 1;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--secondary-gradient);
    transition: width 0.3s ease;
}

.questions-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: 700px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.questions-container::-webkit-scrollbar {
    width: 6px;
}

.questions-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.question-card {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    animation: slideIn 0.4s ease-out;
}

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

.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.q-num {
    background: var(--accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
}

.q-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    display: flex;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option:hover:not(.disabled) {
    background: rgba(255,255,255,0.1);
    border-color: var(--accent);
    transform: translateX(5px);
}

.option.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--success) !important;
    color: #fff;
}

.option.incorrect {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--danger) !important;
    color: #fff;
}

.option.disabled {
    cursor: default;
    opacity: 0.8;
}

.opt-label {
    font-weight: 700;
    color: var(--accent);
}

.option.correct .opt-label { color: #fff; }
.option.incorrect .opt-label { color: #fff; }

.explanation-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    animation: fadeIn 0.5s ease;
}

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

.explanation-title {
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    display: block;
    color: var(--accent);
}

.step-list {
    list-style: none;
}

.step-item {
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 0.75rem;
}

.step-item::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
}

.diagram-box {
    margin-top: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    background: white; /* diagrams are usually black on white */
    padding: 1rem;
}

.diagram-box img {
    width: 100%;
    height: auto;
}

.success-banner {
    margin-top: 2rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    padding: 1.5rem;
    border-radius: 16px;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.secondary-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
}

.hidden {
    display: none;
}

footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 2rem 0;
}
