/* ================================================
   Quiz System Styles
   External stylesheet for all quiz templates
   ================================================ */

/* ================================================
   COMMON STYLES
   ================================================ */

.quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* ================================================
   QUIZ LIST PAGE STYLES (quizzes_list.html)
   ================================================ */

/* Header specific to list page */
.quiz-header {
    padding: 1rem 1rem;
    border-radius: 0 0 15px 15px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
}

.quiz-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.quiz-header p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-top: 0.5rem;
}

.quizzes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 3rem;
}

.quiz-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.quiz-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.quiz-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
}

.quiz-card-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.quiz-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.quiz-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.quiz-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #f0f0f0;
    margin-bottom: 1rem;
}

.meta-item {
    text-align: center;
}

.meta-label {
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.meta-value {
    font-size: 1.3rem;
    color: #667eea;
    font-weight: 700;
}

.quiz-footer {
    display: flex;
    gap: 0.75rem;
}

.btn-quiz {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.btn-take {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-take:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-info {
    background: #f0f0f0;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-info:hover {
    background: #667eea;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.creator-info {
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.5rem;
}

/* ================================================
   QUIZ TAKING PAGE STYLES (quiz.html)
   ================================================ */

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Override header for quiz taking page */
.quiz-container .quiz-header {
    padding: 2rem;
}

.quiz-container .quiz-header h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
}

.quiz-container .quiz-header p {
    margin: 0;
    opacity: 0.9;
}

.progress-bar-container {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    height: 6px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-bar {
    background: white;
    height: 100%;
    transition: width 0.3s ease;
}

.question-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.question-header {
    margin-bottom: 2rem;
}

.question-number {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-top: 0.5rem;
}

.question-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin-top: 1rem;
    object-fit: cover;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer-option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.answer-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.answer-option.selected {
    border-color: #667eea;
    background: #f0f1ff;
}

.answer-option input[type="checkbox"],
.answer-option input[type="radio"] {
    margin-right: 1rem;
    cursor: pointer;
    width: 20px;
    height: 20px;
}

.answer-text {
    flex: 1;
    font-size: 1rem;
    color: #333;
}

.quiz-navigation {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 2rem;
}

.btn-nav {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-prev {
    background: #f0f0f0;
    color: #333;
}

.btn-prev:hover:not(:disabled) {
    background: #e0e0e0;
}

.btn-next {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-submit {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    width: 100%;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.best-result {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.best-result-text {
    color: #2e7d32;
    font-weight: 600;
}

/* ================================================
   QUIZ RESULT PAGE STYLES (quiz_result.html)
   ================================================ */

.result-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
}

.result-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.result-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem;
    text-align: center;
}

.result-header h1 {
    margin: 0;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.result-status {
    font-size: 0.95rem;
    opacity: 0.9;
}

.score-section {
    padding: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.score-display {
    text-align: center;
    margin-bottom: 1rem;
}

.score-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: white;
    border: 4px solid #667eea;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.score-percentage {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
}

.score-label {
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
}

.score-text {
    font-size: 1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}

.quiz-stats {
    padding: 2rem;
    border-bottom: 2px solid #f0f0f0;
    background: #f8f9fa;
}

.quiz-stats h4 {
    margin-top: 0;
    color: #333;
}

.quiz-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.quiz-stat-item:last-child {
    border-bottom: none;
}

.quiz-stat-label {
    color: #666;
}

.quiz-stat-value {
    color: #667eea;
    font-weight: 600;
}

.actions {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-action {
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: block;
}

.btn-retry {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-retry:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-back {
    background: #f0f0f0;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-back:hover {
    background: #667eea;
    color: white;
}

.result-message {
    text-align: center;
    padding: 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.result-excellent {
    color: #10b981;
}

.result-good {
    color: #f59e0b;
}

.result-needs-work {
    color: #ef4444;
}

/* ================================================
   QUIZ CREATE PAGE STYLES (quiz_create.html)
   ================================================ */

.create-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.create-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.create-header h1 {
    margin: 0;
    font-size: 2rem;
}

.create-header p {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
}

.form-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.question-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e0e0e0;
}

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

.question-item-title {
    font-weight: 600;
    color: #333;
}

.btn-remove {
    background: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-remove:hover {
    background: #dc2626;
}

.answer-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.answer-input {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    text-transform: none;
    font-weight: normal;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f0f0f0;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.btn-add {
    background: white;
    border: 2px dashed #667eea;
    color: #667eea;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-add:hover {
    background: #f0f1ff;
}

.info-message {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    padding: 1rem;
    border-radius: 6px;
    color: #2e7d32;
    margin-bottom: 1rem;
}

/* ================================================
   MY QUIZZES PAGE STYLES (my_quizzes.html)
   ================================================ */

.my-quizzes-container {
    margin-bottom: 3rem;
}

.my-quizzes-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.my-quizzes-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    padding: 0.5rem 0;
}

.my-quizzes-table {
    margin: 0;
}

.my-quizzes-table thead th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.4px;
    color: #6b7280;
    background: #f8f9ff;
    border-bottom: 2px solid #eef0ff;
}

.my-quizzes-table td {
    vertical-align: middle;
}

.quiz-title {
    font-weight: 600;
    color: #1f2937;
}

.quiz-subtitle {
    color: #6b7280;
    font-size: 0.85rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.status-draft {
    background: #fff7ed;
    color: #c2410c;
}

.status-published {
    background: #ecfdf3;
    color: #047857;
}

.status-archived {
    background: #f3f4f6;
    color: #4b5563;
}

.action-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ================================================
   QUESTION EDITOR SYMBOL TABS
   ================================================ */

.symbol-tabs {
    margin-bottom: 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.symbol-tabs-header {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: none;
    border-right: 1px solid #e0e0e0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: #eef0ff;
    color: #667eea;
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

.symbol-tabs-content {
    padding: 0.6rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
    gap: 0.45rem;
}

.symbol-btn {
    padding: 0.5rem 0.45rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.83rem;
    cursor: pointer;
    color: #4b5563;
    font-weight: 500;
    transition: all 0.2s ease;
}

.symbol-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
}
