/* Quiz Mode & Question Bank Styles */

/* Segmented Control (Filters) */
.segment-control {
    position: relative;
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--border-color);
}

.segment-btn {
    flex: 1;
    position: relative;
    z-index: 2;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    border-radius: 6px;
}

.segment-btn:hover {
    color: var(--text-main);
    background: transparent; /* Override default button hover */
}

.segment-btn.active {
    color: var(--text-inverse);
}

.segment-glider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: var(--primary-color);
    border-radius: 6px;
    z-index: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Filter Section */
.filters-section {
    background: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

.card-body {
    padding: 24px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Question Bank List */
.question-bank-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.subject-section {
    margin-bottom: 40px;
}

.subject-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    cursor: pointer;
}

.subject-icon {
    color: var(--primary-color);
}

.subject-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text-main);
}

.chapter-card {
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow: hidden;
}

.chapter-header {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.chapter-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.topic-list {
    padding: 0;
}

.topic-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.topic-item:last-child {
    border-bottom: none;
}

.topic-item:hover {
    background: rgba(0, 0, 0, 0.01);
}

.topic-info h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.topic-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.topic-actions {
    display: flex;
    gap: 8px;
}

/* Question Card */
.question-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.question-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--primary-color);
}

.question-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.question-meta {
    display: flex;
    gap: 8px;
}

.question-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-marks {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.badge-type {
    background: rgba(163, 126, 44, 0.1);
    color: var(--secondary-color);
}

.badge-ai {
    background: rgba(0, 96, 57, 0.1);
    color: var(--primary-color);
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--text-main);
}

.btn-show-answer {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-show-answer:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Quiz Full Overlay */
.quiz-full-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    z-index: 10000;
    display: none;
    color: #fff;
}

.quiz-mode-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.quiz-split-view {
    display: flex;
    width: 100%;
    height: 100%;
}

.quiz-left-panel {
    flex: 1;
    background: #fff;
    position: relative;
    border-right: 1px solid #333;
}

.quiz-right-panel {
    width: 400px;
    background: #1a1a1a;
    padding: 24px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #333;
    overflow-y: auto;
}

.whiteboard-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #fff;
    cursor: crosshair;
}

.whiteboard-toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid #eee;
}

.tool-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    gap: 2px;
}

.tool-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2px;
}

.tool-btn:hover {
    background: #f5f5f5;
}

.tool-btn.active {
    background: var(--primary-color);
    color: white;
}

.tool-separator {
    width: 1px;
    height: 24px;
    background: #eee;
}

.color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 1px #ddd;
    cursor: pointer;
}

.color-btn.active {
    transform: scale(1.2);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.quiz-close-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: #333;
    padding: 0;
}

.quiz-close-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5px;
    stroke: #000;
}

.quiz-close-btn:hover {
    background: rgba(0,0,0,0.2);
    color: #000;
}

.quiz-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-question-number {
    color: #888;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quiz-mark-review {
    color: var(--warning-color);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.quiz-question-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #fff;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    background: #2a2a2a;
    border: 1px solid #444;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #ddd;
}

.quiz-option:hover {
    background: #333;
    border-color: #666;
}

.quiz-option.selected {
    background: rgba(0, 96, 57, 0.2);
    border-color: var(--primary-color);
    color: #fff;
}

.quiz-footer {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #333;
}

.quiz-tools {
    display: flex;
    gap: 12px;
}

.quiz-tool-btn {
    background: transparent;
    border: 1px solid #444;
    color: #aaa;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quiz-tool-btn:hover {
    border-color: #666;
    color: #fff;
}

.quiz-nav-btn {
    background: #333;
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
}

.quiz-nav-btn.primary {
    background: var(--primary-color);
}

.quiz-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Question Full View Overlay */
.question-full-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.qfv-left {
    flex: 1;
    max-width: 600px;
    background: #fff;
    padding: 40px;
    border-radius: 16px 0 0 16px;
    height: 80vh;
    overflow-y: auto;
    color: #333;
}

.qfv-right {
    flex: 1;
    max-width: 400px;
    background: #1a1a1a;
    padding: 40px;
    border-radius: 0 16px 16px 0;
    height: 80vh;
    overflow-y: auto;
    color: #fff;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.qfv-close {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    cursor: pointer;
    margin-bottom: 20px;
    font-weight: 500;
}

.qfv-close:hover {
    color: var(--primary-color);
}

.qfv-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.qfv-question-text {
    font-size: 1.4rem;
    line-height: 1.6;
    color: #000;
}

.qfv-reveal-btn {
    background: var(--secondary-color);
    color: #000;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.qfv-reveal-btn:hover {
    transform: scale(1.05);
}

.qfv-answer-content {
    width: 100%;
    display: none;
    text-align: left;
}

.qfv-answer-content.visible {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Accordion Styles for Subject and Chapter Expansion */
.subject-content {
    display: none;
    padding-left: 20px;
}

.subject-section.expanded .subject-content {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.topics-list {
    display: none;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.02);
}

.chapter-item.expanded .topics-list {
    display: block;
    animation: slideDown 0.3s ease-out;
}

/* Icon Rotation */
.expand-icon, .chapter-expand-icon, .topic-expand-icon {
    transition: transform 0.3s ease;
}

.subject-section.expanded .expand-icon,
.chapter-item.expanded .chapter-expand-icon {
    transform: rotate(180deg);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
