/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #ffffff;
    line-height: 1.6;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Header Styles */
header {
    text-align: center;
    color: white;
    margin-bottom: 60px;
    padding: 20px 0;
}

.main-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #c8a2d8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 400;
    margin-top: 10px;
}

/* Session Cards */
.sessions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.session-card {
    background: #2d2d2d;
    border-radius: 16px;
    padding: 28px;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.session-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.difficulty-badge {
    position: absolute;
    top: 20px;
    right: 20px;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-easy {
    background: #4caf50;
    color: #ffffff;
}

.badge-medium {
    background: #ff9800;
    color: #ffffff;
}

.badge-hard {
    background: #f44336;
    color: #ffffff;
}

.session-theme {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px 0;
    padding-right: 100px;
}

.session-description {
    font-size: 1rem;
    color: #ffffff;
    margin: 0 0 24px 0;
    line-height: 1.5;
    opacity: 0.9;
}

.session-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.question-count {
    font-size: 0.95rem;
    color: #ffffff;
    font-weight: 500;
}

.start-quiz-link {
    color: #64b5f6;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
}

.start-quiz-link:hover {
    color: #90caf9;
    text-decoration: underline;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #2d2d2d;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.empty-state p {
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 10px;
}

.hint {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #ffffff;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: bold;
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 
        0 4px 15px rgba(255, 215, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #FFED4E 0%, #FFB347 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(255, 215, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 215, 0, 0.8);
}

.btn-secondary {
    background: linear-gradient(135deg, #4169E1 0%, #00008B 100%);
    color: white;
    border: 2px solid rgba(30, 144, 255, 0.5);
    box-shadow: 
        0 4px 15px rgba(30, 144, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5B7FFF 0%, #1E3A8A 100%);
    box-shadow: 
        0 6px 20px rgba(30, 144, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(30, 144, 255, 0.8);
}

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

/* Quiz Page Styles */
.quiz-header {
    margin-bottom: 40px;
    text-align: left;
}

.back-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1rem;
    display: inline-block;
    margin-bottom: 20px;
    transition: opacity 0.2s;
}

.back-link:hover {
    opacity: 0.8;
}

.quiz-title {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 15px 0;
}

.question-info {
    margin-bottom: 15px;
}

.question-info span {
    color: #ffffff;
    font-size: 1rem;
}

.progress-segments {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.progress-segment {
    flex: 1;
    height: 8px;
    background: #4a4a4a;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.progress-segment.filled {
    background: #64b5f6;
}

.quiz-main {
    margin-bottom: 40px;
}

.quiz-card {
    background: #2d2d2d;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    margin: 0 auto;
}

/* Question Container */
.question-container {
    margin-bottom: 0;
}

.question-text {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 30px;
    line-height: 1.4;
    font-weight: 500;
}

/* Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-label {
    display: flex;
    align-items: center;
    padding: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: #3d3d3d;
    color: #ffffff;
}

.option-label:hover:not(.correct):not(.incorrect) {
    background: #4a4a4a;
}

.option-label.correct {
    background: #d4edda;
    color: #155724;
}

.option-label.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.option-radio {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #64b5f6;
}

.option-radio:disabled {
    cursor: not-allowed;
}

.option-text {
    flex: 1;
}

.option-value {
    margin-left: auto;
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 500;
    font-style: italic;
}

.option-label:hover .option-value {
    color: #ffffff;
}

.option-label.correct .option-value,
.option-label.incorrect .option-value {
    color: inherit;
    opacity: 0.8;
}

.option-text {
    flex: 1;
    font-size: 1.1rem;
    color: inherit;
}

.option-value {
    margin-left: auto;
    font-size: 0.9rem;
    color: #a0a0a0;
    font-weight: 500;
    font-style: italic;
    padding-left: 12px;
}

.option-label:hover .option-value {
    color: #ffffff;
}

.option-label.correct .option-value,
.option-label.incorrect .option-value {
    color: inherit;
    opacity: 0.8;
}

/* Feedback */
.feedback {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

/* Stats Tip */
.stats-tip {
    margin-top: 24px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.15) 0%, rgba(30, 144, 255, 0.15) 100%);
    border-left: 4px solid #64b5f6;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeIn 0.3s ease-in;
}

.stats-tip-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.stats-tip-content {
    flex: 1;
    color: #e3f2fd;
    font-size: 0.95rem;
    line-height: 1.5;
    font-style: italic;
}

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

.feedback-correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
}

.feedback-incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
}

/* Quiz Controls */
.quiz-controls {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.btn-previous {
    background: #2d2d2d;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-previous:hover {
    background: #3d3d3d;
}

.btn-next {
    background: #64b5f6;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-left: auto;
}

.btn-next:hover:not(:disabled) {
    background: #90caf9;
}

.btn-next:disabled {
    background: #4a4a4a;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Results Page */
.results-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 900px;
    position: relative;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(255, 215, 0, 0.2);
    position: relative;
}

.results-header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.final-score {
    font-size: 3rem;
    margin-bottom: 10px;
}

.final-score .score-value {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-percentage {
    font-size: 2rem;
    background: linear-gradient(135deg, #87CEEB 0%, #4169E1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.results-summary {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 8px;
    font-size: 1.2rem;
}

.perfect-score {
    background: #d4edda;
    color: #155724;
}

.great-score {
    background: #d1ecf1;
    color: #0c5460;
}

.good-score {
    background: #fff3cd;
    color: #856404;
}

.ok-score {
    background: #f8d7da;
    color: #721c24;
}

.detailed-results {
    margin-bottom: 40px;
}

.detailed-results h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 20px;
}

.result-item {
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.result-item.correct {
    background: #d4edda;
    border-color: #28a745;
}

.result-item.incorrect {
    background: #f8d7da;
    border-color: #dc3545;
}

.result-question {
    margin-bottom: 12px;
}

.result-number {
    font-weight: bold;
    color: #667eea;
    margin-right: 8px;
}

.result-text {
    font-size: 1.1rem;
    color: #333;
}

.result-answer, .result-correct {
    margin-top: 8px;
    font-size: 0.95rem;
}

.result-label {
    font-weight: 600;
    color: #666;
    margin-right: 8px;
}

.result-value {
    color: #333;
}

.result-value.wrong {
    color: #dc3545;
    text-decoration: line-through;
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
}

/* Generate Page */
.generate-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 800px;
    position: relative;
}

.generate-main {
    margin-top: 30px;
}

.generate-form {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    border: 2px solid rgba(255, 215, 0, 0.2);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e0e0e0;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: #1a1a1a;
    color: #e0e0e0;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.9rem;
    color: #999;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    width: 100%;
}

.btn-generate {
    margin-top: 20px;
    display: inline-block;
}

.status-container {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    border: 2px solid rgba(30, 144, 255, 0.3);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(30, 144, 255, 0.1);
}

.status-header h2 {
    margin-bottom: 20px;
    background: linear-gradient(135deg, #87CEEB 0%, #4169E1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-content {
    margin-top: 20px;
}

.status-message {
    font-size: 1.1rem;
    color: #e0e0e0;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 8px;
    border-left: 4px solid rgba(30, 144, 255, 0.6);
    box-shadow: 0 0 10px rgba(30, 144, 255, 0.2);
}

.result-container {
    background: #d4edda;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #28a745;
}

.result-success h2 {
    color: #155724;
    margin-bottom: 15px;
}

.result-success p {
    color: #155724;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.result-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.error-container {
    background: #f8d7da;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #dc3545;
}

.error-message h2 {
    color: #721c24;
    margin-bottom: 15px;
}

.error-message p {
    color: #721c24;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 24px;
    border-top: 2px solid #f0f0f0;
}

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .sessions-grid {
        grid-template-columns: 1fr;
    }

    .session-theme {
        padding-right: 0;
        margin-bottom: 8px;
    }

    .difficulty-badge {
        position: static;
        margin-bottom: 12px;
    }

    .quiz-title {
        font-size: 1.5rem;
    }

    .quiz-card {
        padding: 24px;
    }

    .question-text {
        font-size: 1.2rem;
    }

    .quiz-controls {
        flex-direction: column;
    }

    .btn-next {
        margin-left: 0;
        width: 100%;
    }
}

