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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5; 
    background-color: #F8F8FA; 
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 15px; 
}

/* --- HEADER STYLING --- */
header {
    background-color: #6A5ACD; 
    color: white;
    padding: 0.8rem 15px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative; 
    display: flex;
    align-items: center;
}

header h1 {
    font-size: 1.5rem; 
    text-align: center; 
    flex-grow: 1; 
    margin: 0 10px; 
    padding: 0; 
}

.header-icon-button { 
    width: 28px; height: 28px; border-radius: 50%;
    background-color: #8A78C5; color: white; text-decoration: none;
    font-size: 1em; font-weight: bold;
    border: 1px solid #6A5ACD; box-shadow: 0 1px 2px rgba(0,0,0,0.1); 
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; line-height: 1; 
    flex-shrink: 0; padding: 0; 
}
.header-icon-button:hover { background-color: #7765B0; transform: scale(1.05); }
.header-icon-button:active { transform: scale(0.95); }

.home-button-header { font-size: 15px; margin-right: 10px; }
.back-button-content-area { font-size: 18px; margin-bottom: 15px; display: inline-flex; }

/* --- MAIN CONTENT & NAVIGATION (index.html) --- */
main { 
    flex-grow: 1; padding: 15px; max-width: 800px; 
    margin: 15px auto; width: 95%; 
}
main.home-container { position: relative; padding-top: 50px; }
.home-container > h2 { text-align: center; color: #483D8B; margin-bottom: 20px; font-size: 1.4rem; }
.home-container > .section-audio-button { 
    position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
    border-radius: 50%; font-size: 16px; padding: 0; background-color: #8A78C5; 
    color: white; border: 1px solid #6A5ACD; box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    cursor: pointer; display: flex; align-items: center; justify-content: center; 
    line-height: 1; transition: background-color 0.2s ease, transform 0.2s ease; z-index: 10; 
}
.home-container > .section-audio-button:hover { background-color: #7765B0; transform: scale(1.05); }
.home-container > .section-audio-button:active { transform: scale(0.95); }
.home-container > .section-audio-button.playing { background-color: #5cb85c; border-color: #4cae4c;}

.section-nav { display: flex; flex-direction: column; gap: 10px; }
.nav-button {
    display: block; background-color: #E6E6FA; color: #483D8B; 
    padding: 12px 15px; text-decoration: none; border-radius: 6px;
    text-align: center; font-size: 1rem; font-weight: 500;
    border: 1px solid #D8BFD8; 
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.nav-button:hover {
    background-color: #D8BFD8; color: #333; transform: translateY(-1px); 
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* --- SECTION PAGE STYLING --- */
.section-container { 
    background-color: #fff; padding: 20px; border-radius: 6px;
    box-shadow: 0 0 12px rgba(0,0,0,0.06); position: relative; 
}
.section-container > .section-audio-button { 
    position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; 
    border-radius: 50%; font-size: 15px; padding: 0; background-color: #8A78C5; 
    color: white; border: 1px solid #6A5ACD; box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    cursor: pointer; display: flex; align-items: center; justify-content: center; 
    line-height: 1; transition: background-color 0.2s ease, transform 0.2s ease; z-index: 10;
}
.section-container > .section-audio-button:hover { background-color: #7765B0; transform: scale(1.05); }
.section-container > .section-audio-button:active { transform: scale(0.95); }
.section-container > .section-audio-button.playing { background-color: #5cb85c; border-color: #4cae4c;}

.section-controls { 
    display: flex; gap: 8px; margin-bottom: 20px; 
    border-bottom: 1px solid #E0E0E0; padding-bottom: 12px; margin-top: 10px; 
}
.section-controls .control-button { 
    padding: 8px 15px; font-size: 0.9rem; border: none;
    border-radius: 4px; cursor: pointer; background-color: #F0F0F0; 
    color: #555; transition: background-color 0.3s ease, color 0.3s ease;
    display: inline-block; width: auto; height: auto; line-height: normal; 
}
.section-controls .control-button.active { background-color: #9370DB; color: white; font-weight: bold; }
.section-controls .control-button:not(.active):hover { background-color: #E0E0E0; }
.control-button:disabled { 
    background-color: #EAEAEA !important; color: #AAAAAA !important;        
    cursor: not-allowed !important; opacity: 0.7;                     
    border: 1px solid #DCDCDC !important; 
}

.content-area { 
    padding: 10px; border: 1px solid #EAEAEA; border-radius: 4px;
    background-color: #FCFCFD;
}
.content-area h2 { color: #6A5ACD; margin-top: 0; margin-bottom: 10px; font-size: 1.3rem; }
.content-area p, .content-area ul { margin-bottom: 8px; font-size: 0.95rem; }
.flashcard-intro-text { font-size: 0.9rem; margin-bottom: 10px; }
.content-area ul { list-style-position: inside; padding-left: 0; margin-left: 20px; }
.content-area ul li { list-style-type: disc; }

/* --- FOOTER --- */
footer { text-align: center; padding: 12px; background-color: #EAEAEA; color: #555; font-size: 0.85rem; margin-top: auto; }

/* --- FLASHCARD STYLING --- */
.flashcard { 
    background-color: #F4F0FA; border: 1px solid #D8BFD8; border-radius: 6px;         
    padding: 15px; padding-bottom: 45px; margin-top: 5px;          
    box-shadow: 0 1px 4px rgba(0,0,0,0.07); position: relative; 
}
.flashcard #flashcardTitle { color: #483D8B; font-size: 1.1rem; margin-bottom: 5px !important; }
.related-principle-display {
    font-size: 0.85em; font-style: italic; color: #7A5FB0; 
    margin-bottom: 10px; margin-top: 0px; padding: 3px 6px;
    background-color: #E6E6FA; border-radius: 4px;
    display: inline-block; border: 1px solid #D8BFD8;
}
#flashcardDefinition { font-size: 0.95rem; margin-bottom: 10px !important; min-height: 1.5em; }
#flashcardDetails h4 { color: #6A5ACD; margin-top: 10px; margin-bottom: 4px; font-size: 1rem; }
.flashcard-detail-item { margin-bottom: 8px; }
.flashcard-detail-content { font-size: 0.9rem; }
.flashcard-detail-content ul { list-style-type: disc; margin-left: 20px; padding-left: 0; }
.flashcard-detail-content ul li { margin-bottom: 4px; }
#flashcardContainer .control-button { 
    margin-right: 5px; display: inline-block; width: auto; height: auto; 
    line-height: normal; padding: 8px 15px; font-size: 0.9rem; 
}
#flashcardContainer .control-button:last-child { margin-right: 0; }
.info-button { 
    width: 26px; height: 26px; border-radius: 50%; 
    font-size: 15px; font-style: italic; font-weight: bold;
    background-color: #9370DB; color: white; 
    border: 1px solid #7A5FB0; box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.2s ease, transform 0.2s ease;
    position: absolute; bottom: 10px; left: 10px; margin: 0;
    display: flex; align-items: center; justify-content: center; line-height: 1; padding: 0;
    cursor: pointer;
}
.info-button:hover { background-color: #7A5FB0; transform: scale(1.05); }
.info-button.details-shown { background-color: #5d3a9b; }
.flashcard-nav button { 
    padding: 6px 12px; font-size: 0.85rem;
    display: inline-block; width: auto; height: auto; line-height: normal;
}
/* In assets/css/style.css, within flashcard styles */
.flashcard-detail-item.brief-answer-section {
    /* background-color: #e8eaf6; /* Example: slightly different background */
    /* border-left: 3px solid #6A5ACD; */
    /* padding-left: 10px; */
}
.flashcard-detail-item.brief-answer-section h4 {
    /* font-style: italic; */
    /* color: #555; */
    display: none; /* Uncomment this if you don't want "Brief Answer" heading to show */
}
.flashcard-detail-item.brief-answer-section .flashcard-detail-content {
    font-weight: 500; /* Slightly bolder */
    background-color: #faf8ff; /* Very light lavender tint */
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px; /* Space before next detail item */
}

#cardStatus { font-size: 0.85rem; margin-bottom: 5px; }

/* --- REFERENCE GUIDES LIST (reference_guides.html) --- */
.guides-list { list-style-type: none; padding-left: 0; }
.guides-list li { margin-bottom: 10px; padding: 10px; background-color: #f9f9f9; border: 1px solid #eee; border-radius: 4px; }
.guides-list li a { text-decoration: none; color: #483D8B; font-weight: 500; display: block; }
.guides-list li a:hover { color: #6A5ACD; text-decoration: underline; }
.list-separator { margin: 15px 0; border: 0; border-top: 1px solid #ddd; }

/* --- DOCUMENT VIEWER (view_document.html) --- */
.document-content-area {}
.document-content-area h1, .document-content-area h2, .document-content-area h3, .document-content-area h4 {
    color: #483D8B; margin-top: 1.2em; margin-bottom: 0.6em;
}
.document-content-area h1 { font-size: 1.8em; } .document-content-area h2 { font-size: 1.5em; }
.document-content-area h3 { font-size: 1.3em; } .document-content-area h4 { font-size: 1.1em; }
.document-content-area p { margin-bottom: 0.8em; }
.document-content-area ul, .document-content-area ol { margin-left: 25px; margin-bottom: 0.8em; }
.document-content-area li { margin-bottom: 0.3em; list-style-type: disc; }
.document-content-area strong { font-weight: bold; }
.document-content-area em { font-style: italic; }
.document-content-area hr { margin: 1.5em 0; border: 0; border-top: 1px solid #ddd; }
.document-content-area details { border: 1px solid #e0e0e0; border-radius: 4px; margin-bottom: 10px; background-color: #fdfdff; }
.document-content-area summary {
    padding: 10px 15px; font-weight: bold; cursor: pointer;
    background-color: #f0f0f8; border-bottom: 1px solid #e0e0e0;
    outline: none; display: flex; align-items: center;
    list-style-position: inside; 
}
.document-content-area summary:hover { background-color: #e6e6f2; }
.document-content-area details[open] summary { border-bottom: 1px solid #e0e0e0; } 
.document-content-area summary > h1, .document-content-area summary > h2,
.document-content-area summary > h3, .document-content-area summary > h4 {
    margin: 0; font-size: 1.1em; display: inline; flex-grow: 1; 
}
.document-content-area summary::marker, 
.document-content-area summary::-webkit-details-marker { color: #6A5ACD; margin-right: 8px; }
.document-content-area .collapsible-content { padding: 15px; border-top: 1px solid #e0e0e0; } 
.document-content-area .collapsible-content > *:first-child { margin-top: 0; }
.document-content-area .collapsible-content > *:last-child { margin-bottom: 0; }
.document-content-area .collapsible-content.nested-collapsible-content { 
    padding-left: 20px; border-left: 2px solid #e0e0e0; margin-left: 5px; 
}
.document-content-area details details summary { background-color: #f8f8fc; font-size: 0.95em; }
.document-content-area details details summary h3,
.document-content-area details details summary h4 { font-size: 1.05em; }

/* --- STUDY PLAN CONTENT AREA (study_plan.html) --- */
.study-plan-content-area {}
.study-plan-content-area details { border: 1px solid #e8e8e8; border-radius: 4px; margin-bottom: 10px; background-color: #fff; }
.study-plan-content-area summary {
    padding: 10px 15px; font-weight: bold; cursor: pointer;
    background-color: #f5f3f9; border-bottom: 1px solid #e8e8e8;
    outline: none; list-style-position: inside; 
}
.study-plan-content-area summary:hover { background-color: #e6e0f2; }
.study-plan-content-area details[open] > summary { border-bottom: 1px solid #d1c9e0; }
.study-plan-content-area .week-group-details > summary { background-color: #e6e6fa; font-size: 1.1em; }
.study-plan-content-area .week-details > summary { background-color: #f0f0fc; font-size: 1.05em; margin-left: 15px; }
.study-plan-content-area .day-details > summary { background-color: #f9f9fd; font-size: 1em; font-weight: normal; margin-left: 30px; }
.study-plan-content-area .day-details > summary strong { font-weight: bold; color: #483D8B; }
.study-plan-content-area .collapsible-plan-content { padding: 10px 15px; border-top: 1px solid #e8e8e8; }
.study-plan-content-area .collapsible-plan-content ul { list-style-type: disc; margin-left: 20px; padding-left: 0; }
.study-plan-content-area .collapsible-plan-content ul li { margin-bottom: 5px; font-size: 0.9em; }
.study-plan-content-area summary::marker,
.study-plan-content-area summary::-webkit-details-marker { color: #6A5ACD; }

/* Welcome Message on Home Page */
.welcome-message-area {
    background-color: #f4f0fa; padding: 15px 20px; border-radius: 6px;
    margin-bottom: 25px; text-align: center; border: 1px solid #d8bfd8;
}
.welcome-message-area #dailyGreeting { color: #483D8B; margin-bottom: 5px; font-size: 1.6em; line-height: 1.2; }
.date-week-info { display: block; font-size: 0.75em; font-weight: normal; color: #555e68; margin-top: 5px; }
.todays-focus-box { background-color: #fff; padding: 15px; border-radius: 4px; border: 1px solid #e0e0e0; margin-top: 10px;}
.todays-focus-box h3 { color: #6A5ACD; font-size: 1.1em; margin-top: 0; margin-bottom: 8px; }
.todays-focus-box #focusText { font-size: 0.95em; color: #333; line-height: 1.4; }

/* --- QUIZ UI STYLING --- */
.quiz-question-text {
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #483D8B;
}
.quiz-options {
    list-style-type: none; padding-left: 0; margin-top: 10px; margin-bottom: 15px;
}
.quiz-options li {
    margin-bottom: 8px; padding: 10px; border: 1px solid #ddd;
    border-radius: 4px; cursor: pointer; transition: background-color 0.2s ease;
}
.quiz-options li:hover { background-color: #f0f0f8; }
.quiz-options li input[type="radio"] { margin-right: 10px; vertical-align: middle; }
.quiz-options li label { vertical-align: middle; cursor: pointer; }
.quiz-feedback-area { margin-top: 15px; padding: 10px; border-radius: 4px; }
.quiz-feedback-message.correct { background-color: #dff0d8; color: #3c763d; border: 1px solid #d6e9c6;}
.quiz-feedback-message.incorrect { background-color: #f2dede; color: #a94442; border: 1px solid #ebccd1;}
.quiz-feedback-message.warning { background-color: #fcf8e3; color: #8a6d3b; border: 1px solid #faebcc;}
.quiz-explanation { margin-top: 10px; font-size: 0.9em; color: #333; }
.quiz-submit-btn, .quiz-next-btn, #restartQuizBtn, #backToSectionOverviewBtn {
    margin-top: 10px; margin-right: 10px;padding: 5px 8px;
}
/* In assets/css/style.css, within or after quiz styles */

.quiz-setup-container {
    padding: 8px;
    text-align: center;
}

.quiz-setup-container h3 {
    margin-bottom: 8px;
    color: #483D8B;
    font-size: 1.2em; /* Adjust as needed */
}

.quiz-options-selector {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

/* Styling for each radio button option container */
.quiz-count-option {
    display: flex;
    align-items: center;
    padding: 6px 15px; /* REDUCED PADDING for smaller buttons */
    border: 1px solid #ddd;
    border-radius: 20px; /* More rounded for a "pill" or sleek look */
    background-color: #f9f9f9;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 60px; /* Adjust if numbers get very large, but for 10,20,50 this is okay */
    text-align: center; /* Helps if label is only thing visible */
}
.quiz-count-option:hover {
    background-color: #eef;
}
.quiz-count-option input[type="radio"] {
    margin-right: 6px;
    cursor: pointer;
     /* Consider visually hiding the default radio and styling the label/container for a custom look */
    /* For example: appearance: none; -webkit-appearance: none; opacity: 0; width:0; height:0; position:absolute; */
}
.quiz-count-option label {
    font-size: 0.90em;
    color: #333;
    cursor: pointer;
    line-height: 1; /* Ensure it aligns well with radio if not hidden */
}

#startQuizWithSelectionBtn {
    background-color: #6A5ACD; 
    color: white;
    padding: 8px 14px; /* Make it a bit more prominent */
    font-size: 1.05em;
    margin-top: 10px; /* Add some space above it */
}
#startQuizWithSelectionBtn:hover {
    background-color: #5948b1;
}
/* Style for when a radio button within .quiz-count-option is checked - target parent .quiz-count-option */
.quiz-count-option input[type="radio"]:checked + label {
    font-weight: bold;
    color: #6A5ACD; /* Purple when selected */
}
/* Alternatively, style the whole div when its radio is checked */
.quiz-count-option input[type="radio"]:checked {
    /* You might not need to style the radio itself much if hidden, 
       but this is how you'd target it if it were visible. */
}
.quiz-count-option:has(input[type="radio"]:checked) { /* Modern CSS to style parent */
    background-color: #e6e0f2; /* Light purple background for selected option */
    border-color: #9370DB;
}
.quiz-count-option:has(input[type="radio"]:checked) { /* Modern CSS to style parent */
    background-color: #9370DB; /* MediumPurple for selected */
    border-color: #7A5FB0;
    box-shadow: 0 0 8px rgba(147, 112, 219, 0.4);
}
.quiz-count-option:has(input[type="radio"]:checked) label {
    color: white; /* White text for selected option */
    font-weight: bold;
}

#startQuizWithSelectionBtn {
    background-color: #6A5ACD; 
    color: white;
    padding: 10px 25px; 
    font-size: 1.05em;
    margin-top: 10px; 
}
/* In assets/css/style.css */
#practiceToolsListContainer ul {
    list-style-type: none;
    padding: 0;
}
#practiceToolsListContainer li {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 12px 15px;
}
#practiceToolsListContainer li a {
    text-decoration: none;
    color: #483D8B;
    font-weight: bold;
    font-size: 1.05em;
    display: block; /* Make whole area clickable */
}
#practiceToolsListContainer li a:hover {
    color: #6A5ACD;
}
#practiceToolsListContainer li p.tool-description {
    font-size: 0.85em;
    color: #555;
    margin-top: 5px;
    margin-bottom: 0;
}
#practiceToolsListContainer hr.tool-separator {
     margin: 20px 0;
     border: 0;
     border-top: 1px dashed #ccc;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 600px) { 
    body { font-size: 14px; }
    header h1 { font-size: 1.3rem; margin: 0 5px; } 
    header { padding: 0.8rem 10px; } 
    .header-icon-button { width: 26px; height: 26px; font-size: 0.9em; } 
    .home-button-header { font-size: 14px; } 
    .back-button-content-area { width: 26px; height: 26px; font-size: 1.2em; margin-bottom: 10px;} 
    main.home-container { padding-top: 45px; }
    .home-container > .section-audio-button { top: 8px; right: 8px; width: 28px; height: 28px; font-size: 15px; }
    .section-container > .section-audio-button { top: 8px; right: 8px; width: 26px; height: 26px; font-size: 14px; }
    main { padding: 10px; margin: 10px auto; }
    .section-container { padding: 15px; }
    .content-area { padding: 8px; }
    .nav-button { padding: 10px 12px; font-size: 0.95rem; }
    .section-controls .control-button { padding: 6px 10px; font-size: 0.85rem; }
    .flashcard { padding: 10px; padding-bottom: 40px; }
    .flashcard #flashcardTitle { font-size: 1rem; }
    #flashcardDefinition { font-size: 0.9rem; }
    .flashcard-detail-content, .flashcard-detail-content ul li { font-size: 0.85rem; }
    .info-button { width: 24px; height: 24px; font-size: 13px; bottom: 8px; left: 8px; }
}
@media (max-width: 400px) {
    header h1 { font-size: 1.1rem; }
    .header-icon-button { width: 24px; height: 24px; font-size: 0.8em; }
    .home-button-header { font-size: 13px; }
    .back-button-content-area { width: 24px; height: 24px; font-size: 1em;}
    .home-container > .section-audio-button { width: 26px; height: 26px; font-size: 14px; }
    .section-container > .section-audio-button { width: 24px; height: 24px; font-size: 13px; }
    .info-button { width: 22px; height: 22px; font-size: 12px; }
}