
/* --- QUIZ SPECIFIC STYLES --- */

/* Quiz Container */
#quiz-wrapper {
    display: none;
    max-width: 800px;
    min-height: 400px;
    margin: 20px auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Media Query for Mobile Phones */
@media (max-width: 768px) {
    #quiz-wrapper {
        width: 95%;
        min-height: auto;
        padding: 15px;
    }
}

/* Question Title */
h2#quiz-title {
    color: #a07fff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.2rem;
    text-shadow: 0 0 10px rgba(160, 127, 255, 0.4);
}

/* Individual Question Box */
.question-card {
    background-color: #1c1c2d;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.5s ease-out;
    width: 100%;
}

.question-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(127, 90, 240, 0.3);
}

.question-count {
    color: #9c27b0;
    font-size: 1rem;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.5;
    color: white;
    word-wrap: break-word;
}

/* Options */
.options {
    list-style: none;
    padding: 0;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    background-color: #2a2a3f;
    color: #ccc;
    padding: 15px 20px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    user-select: none;
    width: 100%;
    white-space: normal;
    word-wrap: break-word;
}

.option:hover {
    background-color: #3b3b5c;
    border-color: #7f5af0;
    color: white;
}

/* Selected/Correct/Incorrect Options */
.option.selected {
    background-color: #4c4c73;
    border-color: #7f5af0;
    color: white;
}

.option.correct {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
    cursor: default;
}

.option.incorrect {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
    cursor: default;
}

/* --- AI Explanation Button --- */
#ai-explanation-container {
    text-align: center;
    margin-top: 20px;
}

#ai-explanation-btn {
    background: linear-gradient(45deg, #7f5af0, #9c27b0);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
  
}

#ai-explanation-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(127, 90, 240, 0.6);
}

/* --- Explanation Text Area --- */
#explanation-text {
    background-color: #2a2a3f;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 1rem;
    line-height: 1.6;
    color: #e0e0e0;
    border: 1px solid #444;
    display: none;
}

/* Media Query for mobile styles on the new AI button */
@media (max-width: 768px) {
    #ai-explanation-btn {
        padding: 10px 20px; /* Reduced padding for a smaller button */
        font-size: 1rem; /* Slightly smaller font size */
        border-radius: 8px;
    }
}

/* --- NEW QUIZ NAVIGATION BUTTON STYLES --- */

/* Wrapper for the navigation buttons */
.navigation-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 25px;
}

/* The parent container for 'Back' and 'Next' buttons */
.main-nav-buttons {
    display: flex;
    gap: 15px;
}

/* The container for 'Go' button and its input */
.jump-to-section {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Individual buttons with the shared 'nav-button' class */
.nav-button {
    background: linear-gradient(45deg, #7f5af0, #9c27b0);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(127, 90, 240, 0.4);
}

/* Hover effect for the main navigation buttons */
.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(127, 90, 240, 0.6);
}

/* Specific styling for the disabled 'Back' button */
.nav-button[disabled] {
    background: #444;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    color: #999;
}

/* The 'Go' button and its input field */
.jump-to-section .nav-button {
    background: #5a428a;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
}

.jump-to-section .nav-button:hover {
    background-color: #7f5af0;
    transform: none;
    box-shadow: none;
}

#jumpTo {
    width: 60px;
    padding: 8px;
    text-align: center;
    font-size: 1rem;
    border: 1px solid #444;
    border-radius: 5px;
    background-color: #2a2a3f;
    color: white;
    box-sizing: border-box;
}

/* Media Query for Mobile Phones */
@media (max-width: 768px) {
    /* Main navigation buttons */
    .nav-button {
        padding: 8px 18px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    /* Adjust the gap between Back/Next buttons */
    .main-nav-buttons {
        gap: 10px;
    }

    /* Adjust the gap for the main navigation group */
    .navigation-buttons {
        gap: 10px;
    }
    
    /* Specific styling for the 'Go' button on mobile */
    .jump-to-section .nav-button {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    /* Adjust the 'Jump To' input field */
    #jumpTo {
        width: 45px;
        padding: 6px;
        font-size: 0.9rem;
    }
}

/* Result Page Buttons */
.result-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.result-buttons button {
    background: linear-gradient(45deg, #7f5af0, #9c27b0);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(127, 90, 240, 0.4);
}

.result-buttons button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(127, 90, 240, 0.6);
}

/* Progress and Result Display */
#progress {
    text-align: center;
    color: #a07fff;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

#result-container {
    background-color: #1c1c2d;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    margin-top: 30px;
    box-shadow: 0 8px 30px rgba(127, 90, 240, 0.2);
    animation: fadeIn 0.5s ease-out;
}

#result-container h2 {
    color: #a07fff;
    font-size: 2.5rem;
    text-shadow: 0 0 15px rgba(160, 127, 255, 0.5);
    margin-bottom: 15px;
}

#result-container p {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 15px 0;
    color: white;
}

/* Premium Wall */
.premium-wall {
    background-color: #1c1c2d;
    border-radius: 20px;
    padding: 30px;
    margin: 30px auto;
    text-align: center;
    box-shadow: 0 8px 30px rgba(127, 90, 240, 0.2);
}

.premium-message h4 {
    color: #a07fff;
    font-size: 2rem;
    margin-bottom: 15px;
}

.premium-message p {
    color: #ccc;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

.premium-button {
    background: linear-gradient(45deg, #7f5af0, #9c27b0);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(127, 90, 240, 0.4);
}

.premium-button:hover {
    transform: translateY(-3px);
    box-shadow: 6px 20px rgba(127, 90, 240, 0.6);
}

/* Comments Section */
.comments-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    margin-top: 25px;
    color: #a07fff;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.comments-toggle-btn:hover {
    color: #fff;
}

#comment-section {
    background: #1c1c2d;
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(127, 90, 240, 0.2);
    display: none;
}

.comment-item {
    background: #2a2a3f;
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 6px;
}

.comment-text {
    font-size: 1rem;
    line-height: 1.4;
    color: #e0e0e0;
}

.comment-input-area textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1.5px solid #444;
    background-color: #2a2a3f;
    color: white;
    resize: vertical;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.comment-input-area textarea:focus {
    outline: none;
    border-color: #7f5af0;
    box-shadow: 0 0 8px rgba(127, 90, 240, 0.3);
}

.submit-comment-btn {
    background: linear-gradient(45deg, #7f5af0, #9c27b0);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.submit-comment-btn:hover {
    box-shadow: 0 0 10px rgba(156, 39, 176, 0.7);
    transform: translateY(-2px);
}


#char-count {
    font-size: 0.9rem;
    color: #888;
}

.loading-comments,
.no-comments,
.error-comments {
    font-style: italic;
    color: #888;
    padding: 12px;
}

/* Utility classes from main page, re-defined for quiz */
.page-title {
    color: #a07fff;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5rem;
    text-shadow: 0 0 15px rgba(160, 127, 255, 0.5);
}
#save-revision-btn {
  margin-left: auto; /* pushes it to extreme right */
}
