/* Custom styles for MCQ Portal - Redesigned Theme & Interactive Elements */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #f43f5e;
    --secondary-hover: #e11d48;
    --dark: #0f172a;
    --dark-alt: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Outfit', sans-serif;
    --success: #22c55e;
    --danger: #ef4444;
}

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

body {
    font-family: var(--font-sans);
    background: var(--light);
    color: var(--text-main);
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    color: white;
    padding: 45px 20px;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

header h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 8px;
}

header p {
    font-size: 1.05rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

nav {
    display: flex;
    justify-content: center;
    background: var(--dark-alt);
    flex-wrap: wrap;
    border-bottom: 2px solid var(--primary);
}

nav a {
    color: white;
    padding: 14px 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

nav a:hover {
    background: var(--primary);
}

.container {
    padding: 20px;
    max-width: 900px;
    margin: auto;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .grid {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    border-top: 5px solid var(--primary);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.15);
}

.card h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--dark);
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.card a {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-right: 10px;
}

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

.card a:nth-of-type(2) {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.card a:nth-of-type(2):hover {
    background: var(--primary);
    color: white;
}

/* Question Area */
.question-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 25px;
    border-left: 5px solid var(--primary);
}

.question-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
}

/* Options */
.options-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-card {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.option-card:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.03);
    transform: translateX(4px);
}

.option-card.selected {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
}

.option-card.correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.08);
}

.option-card.incorrect {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.option-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--light);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    margin-right: 15px;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option-card.selected .option-marker {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.option-card.correct .option-marker {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.option-card.incorrect .option-marker {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

.option-text {
    font-size: 1rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Progress Tracker */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.progress-container {
    height: 8px;
    width: 100%;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-bar-mcq {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Navigation buttons */
.quiz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.btn-nav-quiz {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.95rem;
}

.btn-nav-quiz.prev {
    background: var(--white);
    color: var(--text-main);
    border: 2px solid var(--border-color);
}

.btn-nav-quiz.prev:hover {
    background: var(--light);
}

.btn-nav-quiz.next {
    background: var(--primary);
    color: white;
}

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

.btn-nav-quiz.next:disabled {
    background: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Scorecard circle */
.score-circle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
}

.score-circle {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, var(--border-color) 0deg);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 124px;
    height: 124px;
    border-radius: 50%;
    background: white;
}

.score-text-inner {
    position: relative;
    z-index: 2;
    text-align: center;
}

.score-num {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.1;
}

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

/* Score Summary items */
.metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.metric-box {
    padding: 15px;
    border-radius: 8px;
    background: var(--light);
    text-align: center;
    border: 1px solid var(--border-color);
}

.metric-box.success-box {
    border-left: 4px solid var(--success);
}

.metric-box.danger-box {
    border-left: 4px solid var(--danger);
}

.metric-box .val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
}

.metric-box .lbl {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Quiz Review List */
.review-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--dark);
}

.review-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.review-item.is-correct {
    border-left: 4px solid var(--success);
}

.review-item.is-incorrect {
    border-left: 4px solid var(--danger);
}

.review-question {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 12px;
}

.review-details {
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.review-line {
    padding: 8px 12px;
    border-radius: 6px;
}

.review-line.correct-line {
    background: rgba(34, 197, 94, 0.05);
    color: var(--success);
}

.review-line.user-correct-line {
    background: rgba(34, 197, 94, 0.08);
    color: var(--success);
    font-weight: 600;
}

.review-line.user-incorrect-line {
    background: rgba(239, 68, 68, 0.05);
    color: var(--danger);
}

footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 4px solid var(--primary);
}

.answer {
    display: none;
    color: var(--success);
    font-weight: 600;
    margin-top: 10px;
    padding: 10px 15px;
    background: rgba(34, 197, 94, 0.05);
    border-radius: 6px;
    border: 1px dashed var(--success);
}

/* Learn View items */
.learn-question-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--primary);
    margin-bottom: 20px;
}

.learn-options {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.learn-option-row {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--light);
}

.learn-option-row.is-correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.05);
    color: var(--success);
    font-weight: 600;
}

.btn-reveal-ans {
    margin-top: 15px;
    background: var(--secondary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-reveal-ans:hover {
    background: var(--secondary-hover);
}
