/* Modal Header Styling */
.modal-content h3 {
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.5px;
}
/* Logged-in User Name Styling */
#display-name {
    color: var(--win-white);
    /* Pure white to match w.in */
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: capitalize;
    /* Makes the name look neat */
    margin-right: 5px;
    /* Slight breathing room before the button */
}

/* Optional: Subtle hover effect on the name */
#display-name:hover {
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
    cursor: default;
}

/* Aesthetic Red Cross Button */
.close-btn-wrapper {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    background-color: #ff4d4d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.close-x {
    color: white;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    margin-top: -2px;
    /* Visual centering adjustment */
}

.close-btn-wrapper:hover {
    background-color: #ff1a1a;
    transform: scale(1.15) rotate(90deg);
    /* Modern rotate effect on hover */
    box-shadow: 0 6px 15px rgba(255, 77, 77, 0.6);
}

/* Ensure modal content is the reference point for the button */
.modal-content {
    position: relative;
    padding: 50px 40px 40px 40px;
    /* Extra top padding for the X */
    /* ... keep other modal-content styles ... */
}
:root {
    --bg-light: #f4f7f6;
    --header-black: #000000;
    --dable-grey: #808080;
    --win-white: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: #333;
    overflow-x: hidden;
}

header {
    background-color: var(--header-black);
    padding: 20px 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--dable-grey);
    cursor: pointer;
    text-transform: lowercase;
    transition: transform 0.3s ease;
}

.logo span {
    color: var(--win-white);
}

.logo:hover {
    transform: scale(1.02);
}

#auth-buttons,
#user-profile {
    display: flex;
    gap: 25px;
    align-items: center;
}

.btn-nav {
    background: transparent;
    color: white;
    border: 1.2px solid #333;
    padding: 10px 28px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.btn-nav:hover {
    background: white;
    color: black;
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.container {
    padding: 50px 8%;
    max-width: 1200px;
    margin: 0 auto;
}

.main-grid,
.prelims-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.card {
    background: white;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    text-decoration: none;
    color: #222;
    font-weight: 700;
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--hover-shadow);
}

.rect-card {
    width: 100%;
    background: white;
    padding: 25px 35px;
    margin-bottom: 15px;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: 0.3s;
}

.rect-card:hover {
    transform: scale(1.01);
    box-shadow: var(--hover-shadow);
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 40px;
}

.subject-box {
    background: white;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 700;
    box-shadow: var(--card-shadow);
    transition: 0.3s;
    cursor: pointer;
}

.subject-box:hover {
    transform: translateY(-5px);
    background: #000;
    color: #fff;
}

.about-section {
    padding: 80px 15%;
    background: #ffffff;
    text-align: center;
    line-height: 1.8;
    border-top: 1px solid #eee;
    margin-top: 50px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 40px;
    width: 380px;
    border-radius: 24px;
    text-align: center;
}

input {
    width: 100%;
    padding: 14px;
    margin: 8px 0;
    border: 1.5px solid #eee;
    border-radius: 10px;
    outline: none;
}

.btn-submit {
    background: black;
    color: white;
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.btn-red {
    background: #ff4d4d;
    color: white;
    border: none;
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
}

.btn-grey {
    background: #e0e0e0;
    color: #333;
    border: none;
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
}

.flex-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.today {
    background: #000 !important;
    color: #fff !important;
}
.rect-card.submitted {
    background: #d3d3d3 !important;
    color: #777 !important;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.rect-card.submitted::after {
    content: "Submitted";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #444;
}
.question-card {
    background: white;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.option-btn {
    display: block;
    padding: 12px 18px;
    border-radius: 14px;
    border: 1.5px solid #ddd;
    cursor: pointer;
    transition: 0.3s;
}

.option-btn:hover {
    background: black;
    color: white;
}

.option-btn input {
    display: none;
}

.option-btn input:checked+span {
    font-weight: bold;
}

.nav-btn {
    background: black;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.25s;
}

.nav-btn:hover {
    opacity: 0.85;
}

.submit-btn {
    background: #e0e0e0;
    color: #333;
    padding: 12px 35px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.25s;
}

.submit-btn:hover {
    background: #d6d6d6;
}

#quiz-navigation {
    text-align: center;
    margin-top: 30px;
}
#timer {
    color: #f5f5f5;
    /* Slightly softer than pure white */
    font-weight: 700;
    /* Strong but not too bold */
    font-size: 1.1rem;
    /* Slight increase only */
    letter-spacing: 1px;
    text-shadow: 0 0 4px rgba(255, 255, 255, 0.35);
    /* Subtle glow */
}
.option-btn.selected {
    background: #524c4c;
    /* Faint grey */
    color: #000;
    /* Keep text readable */
    border-color: #d0d0d0;
}
/* ================= THEME TOGGLE ================= */

.theme-toggle {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: 0.3s;
}

.theme-toggle:hover {
    background: white;
    color: black;
}

/* ================= DARK MODE ================= */

body.dark-mode {
    --bg-light: #121212;
    --card-shadow: 0 10px 30px rgba(255, 255, 255, 0.05);
}

body.dark-mode {
    background-color: #121212;
    color: #f5f5f5;
}

/* Dark mode softer grey blocks */

body.dark-mode {
    background-color: #1a1a1a;
    color: #f5f5f5;
}

body.dark-mode .question-card {
    background: #2a2a2a;
    /* soft grey instead of black */
    color: #f5f5f5;
}

body.dark-mode .option-btn {
    border-color: #444;
}

body.dark-mode .option-btn.selected {
    background: #2a2a2a;
}

body.dark-mode .nav-btn {
    background: white;
    color: black;
}

body.dark-mode .submit-btn {
    background: #444;
    color: white;
}
/* Dark mode modal adjustment */

body.dark-mode .modal-content {
    background: #1e1e1e;
    color: #f5f5f5;
}

body.dark-mode .btn-grey {
    background: #333;
    color: #f5f5f5;
}

body.dark-mode .btn-red {
    background: #c0392b;
}
/* Ensure modal heading is white in dark mode */

body.dark-mode .modal-content h3 {
    color: #ffffff;
}
/* Dark mode selected option styling */

body.dark-mode .option-btn.selected {
    background: #3a3a1f;
    /* very faint warm yellow tint */
    color: #b1a864;
    /* soft yellow text */
    border-color: #555200;
    font-weight: 700;
}
/* ================= QUIZ LAYOUT ================= */

.quiz-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.quiz-left {
    flex: 4.5;
}

.quiz-right {
    flex: 0.8;
    position: sticky;
    top: 100px;
    background: white;
    padding: 20px;
    border-radius: 18px;
    box-shadow: var(--card-shadow);
    height: fit-content;
}

.palette-title {
    margin-bottom: 15px;
    font-weight: 700;
}

/* Question number grid */

#question-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.palette-btn {
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: 0.2s;
}

/* Attempt states */
.palette-unattempted {
    background: #e0e0e0;
    color: #555;
}

.palette-attempted {
    background: #2ecc71;
    color: white;
}

/* Dark mode palette */

body.dark-mode .quiz-right {
    background: #2a2a2a;
}

body.dark-mode .palette-unattempted {
    background: #444;
    color: #ccc;
}

body.dark-mode .palette-attempted {
    background: #27ae60;
}
.result-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    text-align: center;
}

body.dark-mode .result-card {
    background: #2a2a2a;
    color: #f5f5f5;
}

.result-card h2 {
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.result-label {
    display: block;
    font-size: 0.9rem;
    color: #777;
}

body.dark-mode .result-label {
    color: #bbb;
}

.result-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
}

.correct {
    color: #2ecc71;
}

.wrong {
    color: #e74c3c;
}
/* REVIEW SECTION */

.review-container {
    margin-top: 40px;
}

.review-question {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}

body.dark-mode .review-question {
    background: #2a2a2a;
    color: #f5f5f5;
}

.review-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.review-option {
    padding: 10px 15px;
    border-radius: 10px;
    background: #f1f1f1;
}

body.dark-mode .review-option {
    background: #333;
}

/* Correct & Selected */
.review-correct-selected {
    background: #2ecc71 !important;
    color: white;
}

/* Wrong & Selected */
.review-wrong-selected {
    background: #e74c3c !important;
    color: white;
}

/* Correct (when user selected wrong) */
.review-correct {
    background: #27ae60 !important;
    color: white;
}/* ================= QUIZ END TEST MODAL ================= */

#endTestModal .modal-content p {
    font-size: 0.95rem;
    color: #555;
}

body.dark-mode #endTestModal .modal-content p {
    color: #ccc;
}
.btn-white {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background-color: white;
    color: black;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s ease;
}

.btn-white:hover {
    background-color: #f5f5f5;
}
/* ================= HABIT TRACKER ================= */

.habit-container {
    max-width: 1100px;
    margin: 0 auto;
}

/* Main Card */

.habit-card {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    margin-bottom: 40px;
}

/* Habit Row Layout */

/* ================= HABIT ROW LAYOUT ================= */

.habit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    gap: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.habit-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.95rem;
}

.habit-actions {
    display: flex;
    gap: 8px;
}

.habit-row:last-child {
    border-bottom: none;
}

.habit-name {
    font-weight: 600;
    font-size: 0.95rem;
}

/* Tick / Cross Buttons */

/* ================= HABIT BUTTONS ================= */

/* ================= HABIT BUTTONS ================= */

.habit-actions {
    display: flex;
    gap: 12px;
}

/* Base Button */

.habit-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

/* TICK — GREEN */

.habit-tick {
    background: #2ecc71;
    /* strong green */
    color: white;
}

.habit-tick:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

/* CROSS — RED */

.habit-cross {
    background: #e74c3c;
    /* strong red */
    color: white;
}

.habit-cross:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* SELECTED STATES */

.habit-selected-tick {
    box-shadow: 0 0 0 3px #1abc9c inset;
}

.habit-selected-cross {
    box-shadow: 0 0 0 3px #922b21 inset;
}

/* ================= SCORE SECTION ================= */

.habit-score-box {
    margin-top: 30px;
    padding: 25px;
    background: #f8f8f8;
    border-radius: 18px;
    text-align: center;
}

.habit-score-box h3 {
    margin-bottom: 10px;
}

.habit-score-value {
    font-size: 2rem;
    font-weight: 700;
}

/* ================= WEEK GRID ================= */

.week-grid-wrapper {
    margin-top: 50px;
}

.week-title {
    font-weight: 700;
    margin-bottom: 20px;
}

/* 10 columns → 101 weeks → 11 rows (last row single box) */

.week-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 14px;
}

/* Week Box */

.week-box {
    background: #f0f0f0;
    padding: 14px 8px;
    border-radius: 14px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    transition: 0.25s ease;
}

.week-box span {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Current Week */

.week-current {
    background: black;
    color: white;
    transform: scale(1.08);
}

/* Future Weeks */

.week-future {
    opacity: 0.35;
}

/* Positive Score */

.week-positive {
    background: #2ecc71;
    color: white;
}

/* Negative Score */

.week-negative {
    background: #e74c3c;
    color: white;
}
/* ================= EDIT BUTTON ================= */

.habit-edit-btn {
    margin-top: 20px;
    background: black;
    color: white;
    padding: 12px 22px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.habit-edit-btn:hover {
    opacity: 0.85;
}

/* ================= DARK MODE ================= */

body.dark-mode .habit-card {
    background: #2a2a2a;
    color: #f5f5f5;
}

body.dark-mode .habit-row {
    border-bottom: 1px solid #3a3a3a;
}

body.dark-mode .habit-score-box {
    background: #1f1f1f;
}

body.dark-mode .week-box {
    background: #333;
    color: #ddd;
}

body.dark-mode .week-current {
    background: white;
    color: black;
}

body.dark-mode .week-positive {
    background: #27ae60;
}

body.dark-mode .week-negative {
    background: #c0392b;
}
/* Default */

.habit-btn {
    flex: 1;
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: 0.2s ease;
}

/* Tick */

.habit-tick {
    background: #2ecc71;
    color: white;
}

/* Cross */

.habit-cross {
    background: #e74c3c;
    color: white;
}

/* Greyed Out State */

.habit-disabled {
    background: #dcdcdc !important;
    color: #777 !important;
    cursor: not-allowed;
    transform: none !important;
}
/* ================= CENTER HABIT TRACKER ================= */

.habit-tracker-card {
    max-width: 750px;
    /* controls width */
    margin: 0 auto 50px auto;
    /* center horizontally + spacing below */
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
}

/* Center each habit row inside card */

.habit-row {
    max-width: 600px;
    margin: 0 auto;
}
/* ================= HABIT ENTRY BUTTON ================= */

.habit-entry-btn {
    background: black;
    color: white;
    padding: 18px 40px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    /* fully semicircular edges */
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.habit-entry-btn:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}
/* Tick selected */
.selected-tick {
    background-color: #2ecc71 !important;
    color: white !important;
}

/* Cross selected */
.selected-cross {
    background-color: #e74c3c !important;
    color: white !important;
}

/* Grey disabled */
.disabled-btn {
    background-color: #d3d3d3 !important;
    color: #777 !important;
}
.tick-btn {
    background: #2ecc71;
    color: white;
}

.cross-btn {
    background: #e74c3c;
    color: white;
}

.selected-tick {
    background: #27ae60 !important;
    color: white !important;
}

.selected-cross {
    background: #c0392b !important;
    color: white !important;
}

.disabled-btn {
    background: #dcdcdc !important;
    color: #888 !important;
}