/* === LearnSpark High-End Restyle === */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    --font-family: 'Nunito', sans-serif;
    
    --primary-color: #4F46E5; /* Indigo */
    --primary-color-dark: #4338CA;
    --secondary-color: #10B981; /* Emerald */
    --accent-color: #F59E0B; /* Amber */
    
    --background-color: #F3F4F6; /* Cool Gray 100 */
    --card-bg: #FFFFFF;
    --card-header-bg: linear-gradient(to right, #F9FAFB, #F3F4F6);

    --text-color: #111827; /* Cool Gray 900 */
    --text-color-light: #4B5563; /* Cool Gray 600 */
    --border-color: #E5E7EB; /* Cool Gray 300 */

    --correct-color: #16A34A; /* Green 600 */
    --correct-bg: #F0FDF4; /* Green 50 */
    --incorrect-color: #DC2626; /* Red 600 */
    --incorrect-bg: #FEF2F2; /* Red 50 */
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --border-radius: 16px;
    --transition-speed: 0.2s;
}

/* --- General Setup --- */
body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
*, *:before, *:after { box-sizing: border-box; }

main {
    flex: 1;
    max-width: 800px;
    margin: 3rem auto;
    padding: 1rem;
    width: 95%;
}

h1, h2, h3, h4 { font-weight: 800; }
h2 { font-size: 2.25rem; text-align: center; margin-bottom: 0.5rem; color: var(--text-color); }
.view h2 + p { text-align: center; margin-bottom: 3rem; font-size: 1.125rem; color: var(--text-color-light); }

/* --- Header & Navigation --- */
header {
    background: var(--card-bg);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}
header h1 { 
    font-size: 1.75rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}
.nav-buttons button {
    background-color: #F9FAFB;
    color: var(--text-color-light);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease-in-out;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-buttons button:hover {
    background-color: #F3F4F6;
    color: var(--text-color);
    border-color: #9CA3AF;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hidden { display: none !important; }

/* --- View Management & Animations --- */
.view { display: none; animation: fadeInScaleUp 0.4s ease-in-out; }
.view.active { display: block; }
@keyframes fadeInScaleUp {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Selection Grids --- */
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
.choice-btn {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    transition: all var(--transition-speed) ease-in-out;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.choice-btn:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* --- Test View --- */
#question-container {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}
.skill-tag {
    background-color: var(--primary-color);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 2rem;
}
.question-text {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 3rem;
    color: var(--text-color);
}
.options-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.option-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    background-color: #F9FAFB;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-speed) ease-in-out;
    color: var(--text-color);
}
.option-btn:hover:not(.selected) { border-color: var(--primary-color); color: var(--primary-color); background-color: #EFF6FF; }
.option-btn.selected { border-color: var(--primary-color); background-color: var(--primary-color); color: white; box-shadow: 0 0 15px rgba(59, 130, 246, 0.3); }
.option-btn.correct { border-color: var(--correct-color) !important; background-color: var(--correct-color) !important; color: white !important; }
.option-btn.incorrect { border-color: var(--incorrect-color) !important; background-color: var(--incorrect-color) !important; color: white !important; }

/* SVG and Image Option Styles */
#question-image-sequence, #question-svg-container { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-bottom: 2rem; }
#question-svg-container svg { max-width: 350px; width: 100%; height: auto; border: 1px solid var(--border-color); border-radius: var(--border-radius); }
#question-image-sequence { border-bottom: 2px solid var(--border-color); padding-bottom: 2rem; }
#question-image-sequence svg { width: 100px; height: 100px; border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-sm); }
.options-grid.image-options { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.option-image-btn { padding: 0.5rem; background-color: var(--card-bg); border: 2px solid var(--border-color); border-radius: 12px; cursor: pointer; transition: all var(--transition-speed) ease-in-out; line-height: 0; box-shadow: var(--shadow-sm); }
.option-image-btn:hover:not(.selected) { border-color: var(--primary-color); transform: scale(1.05); }
.option-image-btn.selected { border-color: var(--primary-color); box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); transform: scale(1.05); }
.option-image-btn.correct { border-color: var(--correct-color) !important; box-shadow: 0 0 15px rgba(22, 163, 74, 0.5) !important; }
.option-image-btn.incorrect { border-color: var(--incorrect-color) !important; }
.option-image-btn svg { width: 100%; height: auto; display: block; border-radius: 8px; }

/* Feedback & Action Buttons */
#feedback-area { margin-top: 2.5rem; text-align: center; min-height: 2rem; }
#feedback-correct-incorrect { font-size: 1.75rem; font-weight: 800; }
#feedback-explanation { margin-top: 1.5rem; padding: 1.5rem; background-color: #F9FAFB; border-radius: var(--border-radius); text-align: left; font-size: 1.05rem; font-weight: 500; color: var(--text-color-light); line-height: 1.8; border: 1px solid var(--border-color); }
#feedback-explanation h4 { margin: 0 0 0.75rem 0; color: var(--text-color); font-weight: 700; font-size: 1.1rem; }
.action-buttons { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; border-top: 1px solid var(--border-color); padding-top: 2rem; }
.primary-btn, .secondary-btn { border: none; padding: 1rem 2rem; font-size: 1.1rem; font-weight: 700; border-radius: 12px; cursor: pointer; transition: all 0.2s ease-in-out; box-shadow: var(--shadow-md); }
.primary-btn { background-image: linear-gradient(to right, var(--primary-color), #60A5FA); color: white; }
.primary-btn:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.primary-btn:active { transform: translateY(0px) scale(0.98); }
.secondary-btn { background-color: var(--accent-color); color: white; }
.secondary-btn:hover { background-color: #FBBF24; box-shadow: var(--shadow-lg); }

/* Loading & Modals */
#loading-view { text-align: center; margin-top: 4rem; }
#loading-view p { font-size: 1.25rem; color: var(--text-color-light); }
.spinner { border: 8px solid #E5E7EB; border-top: 8px solid var(--primary-color); border-radius: 50%; width: 60px; height: 60px; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(17, 24, 39, 0.6); backdrop-filter: blur(5px); align-items: center; justify-content: center; animation: fadeIn 0.3s; }
.modal.active { display: flex; }
.modal-content { background-color: var(--card-bg); padding: 0; border: 1px solid var(--border-color); width: 90%; max-width: 600px; border-radius: var(--border-radius); position: relative; box-shadow: var(--shadow-lg); overflow: hidden; }
.close-btn { color: #9CA3AF; position: absolute; top: 10px; right: 15px; font-size: 32px; font-weight: bold; cursor: pointer; transition: color 0.2s; z-index: 10; }
.close-btn:hover, .close-btn:focus { color: var(--text-color); }
.modal-content h3 { padding: 1.5rem 2rem; margin: 0; border-bottom: 1px solid var(--border-color); background: var(--card-header-bg); color: var(--text-color); }
#sparky-response { padding: 30px; margin-top: 1rem; white-space: pre-wrap; line-height: 1.8; text-align: left; max-height: 60vh; overflow-y: auto; font-size: 1.1rem; }

.report-content { max-width: 700px; }
.report-header { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: white; padding: 1.5rem 2rem; text-align: center; }
.report-header h3 { margin: 0 0 0.25rem 0; font-size: 1.75rem; color: white; background: transparent; border-bottom: none; padding: 0; }
.report-header p { margin: 0; color: rgba(255, 255, 255, 0.9); font-weight: 500; }
.report-body { padding: 1.5rem 2rem; max-height: 60vh; overflow-y: auto; }
.report-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; align-items: center; margin-bottom: 2.5rem; }
.report-chart-container { max-width: 160px; margin: 0 auto; }
.report-score-container { text-align: center; background-color: #EFF6FF; padding: 1.5rem 1rem; border-radius: 12px; border: 1px solid var(--primary-color); }
.report-score-container h4 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--primary-color); }
#report-score { font-size: 2.5rem; font-weight: 800; color: var(--primary-color); margin: 0.5rem 0 0 0; }
.report-analysis h4 { font-size: 1.25rem; margin-bottom: 1rem; border-bottom: 2px solid var(--border-color); padding-bottom: 0.5rem; display: flex; align-items: center; gap: 0.75rem; }
.report-analysis h4 .fas { font-size: 1.1rem; }
#report-ai-analysis { background-color: var(--background-color); padding: 1.5rem; border-radius: 12px; margin-bottom: 2.5rem; line-height: 1.7; font-weight: 500; color: var(--text-color-light); border: 1px solid var(--border-color); }
.spinner-small { border: 4px solid #E5E7EB; border-top: 4px solid var(--accent-color); border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 1rem auto; }
#report-strengths-list, #report-weaknesses-list { list-style: none; padding: 0; margin: 0 0 2rem 0; }
.report-analysis li { padding: 0.75rem; border-bottom: 1px solid #F3F4F6; font-weight: 600; color: var(--text-color); }
.report-analysis li:last-child { border-bottom: none; }
#report-strengths-list { border-left: 4px solid var(--correct-color); padding-left: 1rem; background-color: var(--correct-bg); border-radius: 8px; }
#report-weaknesses-list { border-left: 4px solid var(--incorrect-color); padding-left: 1rem; background-color: var(--incorrect-bg); border-radius: 8px; }
.report-footer { padding: 1.5rem 2rem; background-color: #F9FAFB; text-align: right; border-top: 1px solid var(--border-color); }

/* --- Landing/Subscription Page Styles --- */
.landing-header { background: var(--card-bg); padding: 1rem 2rem; box-shadow: var(--shadow-sm); }
.landing-main { max-width: 1024px; margin: 4rem auto; padding: 1rem; width: 95%; }
.landing-content { text-align: center; }
.landing-content .subtitle { font-size: 1.25rem; max-width: 600px; margin: 0 auto 4rem; }
.subscription-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.plan-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 2rem; box-shadow: var(--shadow-md); transition: all var(--transition-speed) ease-in-out; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.plan-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }
.plan-card.featured { border-width: 2px; border-color: var(--primary-color); transform: scale(1.05); }
.plan-card.featured:hover { transform: scale(1.08) translateY(-10px); }
.plan-badge { position: absolute; top: 15px; right: -30px; background-color: var(--primary-color); color: white; padding: 0.3rem 2rem; transform: rotate(45deg); font-size: 0.8rem; font-weight: 700; }
.plan-header { margin-bottom: 2rem; }
.plan-header h3 { font-size: 1.5rem; margin: 0; }
.plan-header .price { font-size: 3rem; font-weight: 800; color: var(--text-color); margin: 0.5rem 0; }
.plan-header .price span { font-size: 1rem; font-weight: 600; color: var(--text-color-light); }
.plan-features { list-style: none; padding: 0; margin: 0 0 2.5rem 0; text-align: left; flex-grow: 1; }
.plan-features li { padding: 0.5rem 0; color: var(--text-color-light); display: flex; align-items: center; gap: 0.75rem; font-weight: 500; }
.plan-features li .fas { color: var(--secondary-color); width: 20px; text-align: center; }
.plan-btn { width: 100%; padding: 1rem; }
.free-trial-container { margin-top: 5rem; display: flex; flex-direction: column; align-items: center; }
.free-trial-container p { font-size: 1.1rem; font-weight: 600; margin: 1rem 0; }
.trial-limit-text { font-size: 0.9rem !important; color: var(--text-color-light) !important; margin-top: 0.5rem !important; }
.nav-btn-primary, .nav-btn-secondary { display: inline-block; padding: 0.6rem 1.2rem; border-radius: 10px; font-weight: 700; font-size: 0.9rem; text-decoration: none; transition: all var(--transition-speed) ease-in-out; margin-left: 0.5rem; }
.nav-btn-primary { background-color: var(--primary-color); color: white; }
.nav-btn-primary:hover { background-color: var(--primary-color-dark); }
.nav-btn-secondary { background-color: #F3F4F6; color: var(--text-color-light); }
.nav-btn-secondary:hover { background-color: #E5E7EB; color: var(--text-color); }
footer { text-align: center; padding: 2rem 1rem; margin-top: 2rem; color: var(--text-color-light); font-size: 0.9rem; }
.hero-section { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; padding: 4rem 0; }
.hero-text h2 { font-size: 3rem; font-weight: 800; line-height: 1.2; text-align: left; margin-bottom: 1.5rem; }
.hero-text p { font-size: 1.125rem; margin-bottom: 2rem; }
.hero-btn { margin-right: 1rem; padding: 0.8rem 1.8rem; }
.hero-image img { width: 100%; height: auto; border-radius: var(--border-radius); }
.features-section { padding: 4rem 0; text-align: center; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; margin-top: 3rem; text-align: left; }
.feature-card { background: var(--card-bg); padding: 2rem; border-radius: var(--border-radius); box-shadow: var(--shadow-md); }
.feature-card .fas { font-size: 2rem; color: var(--primary-color); margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.landing-footer { border-top: 1px solid var(--border-color); padding: 2rem 0; margin-top: 2rem; text-align: center; }
.question-table { width: 80%; margin: 1.5rem auto; border-collapse: collapse; font-size: 1.1rem; text-align: center; }
.question-table th, .question-table td { border: 2px solid var(--border-color); padding: 0.75rem; }
.question-table th { background-color: #F9FAFB; font-weight: 700; }
.question-table td { font-weight: 600; }
@media (max-width: 768px) {
    .hero-section { grid-template-columns: 1fr; text-align: center; }
    .hero-text h2 { text-align: center; }
    .hero-image { grid-row: 1; margin-bottom: 2rem; }
}

/* === DEFINITIVE CANCELLATION MODAL STYLES === */
/* This ensures the modal body text is centered as a default */
#cancel-modal .modal-body {
    padding: 1.5rem 2rem 2rem;
    text-align: center;
}
/* This makes the form itself align its items (labels, inputs) to the left */
#cancel-modal #cancel-form {
    text-align: left;
}
/* Style for the containers of labels and inputs */
#cancel-modal .input-group {
    margin-bottom: 1.5rem;
}
/* Style for the text labels */
#cancel-modal .input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color-light);
}
/* This is the key style for the form fields */
#cancel-modal .input-group select,
#cancel-modal .input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Soft, rounded corners */
    font-size: 1rem;
    font-family: var(--font-family);
    background-color: #F9FAFB;
    transition: border-color 0.2s, box-shadow 0.2s;
}
/* Adds a highlight effect when a user clicks into a field */
#cancel-modal .input-group select:focus,
#cancel-modal .input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}
/* Styles for the success/error message area */
#cancel-modal .feedback-message {
    min-height: 20px;
    font-weight: 600;
    margin-bottom: 1.5rem;
}
/* Center the button by making its parent a flex container */
#cancel-modal #cancel-form {
    display: flex;
    flex-direction: column;
    align-items: center; /* This centers the button */
}
#cancel-modal #cancel-form .input-group {
    width: 100%; /* Ensures the input groups stay full-width */
}
#cancel-modal #cancel-form .primary-btn {
    width: 80%; /* Makes the button slightly smaller than full-width */
    margin-top: 1rem;
}

/* --- NEW: STYLES FOR ABOUT & CONTACT PAGES --- */
.page-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}
.page-content h2, .page-content h3 {
    text-align: left;
}
.page-content h3 {
    margin-top: 3rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}
.about-card {
    background: #F9FAFB;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.features-list {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}
.features-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-color-light);
}
.features-list .fas {
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-top: 0.25rem;
}
.cta-section {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    background-color: #EFF6FF;
    border-radius: var(--border-radius);
}
.contact-form-container {
    max-width: 600px;
    margin: 2rem auto 0;
}
.footer-links {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}
.footer-links a {
    color: var(--text-color-light);
    text-decoration: none;
    font-weight: 600;
}
.footer-links a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

/* In public/style.css (add this at the very end) */

/* --- NEW: Reusable Styled Form Component --- */
.styled-form {
    text-align: left; /* Aligns labels to the left */
    display: flex;
    flex-direction: column;
    align-items: center; /* This is what centers the submit button */
}

.styled-form .input-group {
    width: 100%; /* Makes the input groups take up the full width */
    margin-bottom: 1.5rem;
}

.styled-form .input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color-light);
}

/* This rule targets all input, select, and textarea fields within the form */
.styled-form .input-group input,
.styled-form .input-group select,
.styled-form .input-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px; /* <-- This creates the modern rounded corners */
    font-size: 1rem;
    font-family: var(--font-family);
    background-color: #F9FAFB;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* This adds the nice blue glow when a user clicks into a field */
.styled-form .input-group input:focus,
.styled-form .input-group select:focus,
.styled-form .input-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* General style for the button inside the styled form */
.styled-form .primary-btn {
    width: 80%; /* Makes the button slightly smaller than the container */
    margin-top: 1rem;
}

/* We also need to center the container's text on the contact page */
.contact-form-container {
    max-width: 600px;
    margin: 2rem auto 0;
    text-align: center; /* <-- ADD THIS LINE */
}

/* In public/style.css (add at the end) */

/* --- Account Management Modal Styles --- */
#account-modal .modal-body {
    padding: 1.5rem 2rem 2rem;
}
.account-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background-color: #F9FAFB;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}
.account-details-grid div {
    font-size: 1rem;
}
#account-modal hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}
#account-modal h4 {
    font-size: 1.25rem;
    margin-top: 0;
    margin-bottom: 1rem;
}
.member-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #F3F4F6;
}
.member-item:last-child {
    border-bottom: none;
}
.member-item.invited span {
    color: var(--text-color-light);
    font-style: italic;
}
.remove-member-btn {
    background: none;
    border: 1px solid var(--incorrect-color);
    color: var(--incorrect-color);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.remove-member-btn:hover {
    background-color: var(--incorrect-color);
    color: white;
}
#invite-form p {
    text-align: center;
    color: var(--text-color-light);
    margin-bottom: 1.5rem;
}
/* --- NEW: Writing Test View Styles --- */
#writing-prompt-container {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}
#writing-prompt-image-container img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}
#writing-instructions {
    background-color: #EFF6FF; /* light blue bg */
    border: 1px solid #BFDBFE; /* light blue border */
    color: #1E40AF; /* dark blue text */
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    font-weight: 500;
    line-height: 1.6;
}
.writing-input-area {
    margin-bottom: 2rem;
}
#writing-response-area {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    font-family: var(--font-family);
    font-size: 1.1rem;
    line-height: 1.7;
    transition: all 0.2s ease-in-out;
}
#writing-response-area:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* --- NEW: Writing Report View Styles --- */
#writing-report-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden; /* To keep the header contained */
    box-shadow: var(--shadow-lg);
}
.prompt-recall {
    background-color: #F9FAFB;
    padding: 1rem;
    border-radius: 8px;
    font-style: italic;
    color: var(--text-color-light);
    border-left: 4px solid var(--primary-color);
}
#writing-analysis-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.analysis-criterion-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}
.analysis-criterion-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}
.criterion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F9FAFB;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.criterion-header h5 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}
.criterion-score {
    font-weight: 800;
    font-size: 1.2rem;
    background-image: linear-gradient(to right, var(--primary-color), #60A5FA);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    min-width: 50px;
    text-align: center;
}
.criterion-feedback {
    padding: 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color-light);
    margin: 0;
}
/* Add this new block of CSS at the end of the file */
/* Find and REPLACE the "#reading-passage-container" styles with this more generic version */

/* --- Stimulus Container Styles (for Reading & Science) --- */
#stimulus-container {
    background-color: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem 1.5rem;
    margin-bottom: 2rem;
}
#stimulus-container h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    color: var(--text-color);
}
#stimulus-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color-light);
    white-space: pre-wrap; /* Preserves paragraphs */
    max-height: 300px;
    overflow-y: auto;
}
/* Style for markdown tables generated by the AI */
#stimulus-content table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
#stimulus-content th, #stimulus-content td {
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: left;
}
#stimulus-content th {
    background-color: #F3F4F6;
}/* --- NEW: Chatbot Widget Styles --- */
#chatbot-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1001;
}
#chatbot-toggle-btn {
    background-image: linear-gradient(to right, var(--primary-color), #60A5FA);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease-in-out;
}
#chatbot-toggle-btn:hover {
    transform: scale(1.1);
}
#chatbot-toggle-btn svg {
    width: 30px;
    height: 30px;
}
#chatbot-window {
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 80vh;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    pointer-events: none;
}
#chatbot-window:not(.hidden) {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}
#chatbot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--card-header-bg);
    border-bottom: 1px solid var(--border-color);
}
#chatbot-header h5 {
    margin: 0;
    font-size: 1.1rem;
}
#chatbot-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color-light);
}
#chatbot-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
}
.chat-message {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    max-width: 85%;
    line-height: 1.6;
}
.chat-message.user {
    background-color: var(--primary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.chat-message.bot {
    background-color: #F3F4F6;
    color: var(--text-color);
    margin-right: auto;
    border-bottom-left-radius: 4px;
}
#chatbot-form {
    display: flex;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
}
#chatbot-input {
    flex-grow: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    margin-right: 0.5rem;
}
#chatbot-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0 1rem;
    cursor: pointer;
    font-weight: 600;
}
/* --- NEW: Revamped Landing Page Styles --- */

/* General Section Styling */
.landing-main section {
    padding: 4rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Hero Section Updates */
.hero-text h2 {
    font-size: 3.5rem; /* Larger, more impactful headline */
}

/* Trust Bar Section */
.trust-bar {
    text-align: center;
    background-color: var(--background-color);
    padding: 1.5rem 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.trust-bar span {
    color: var(--text-color-light);
    margin-right: 1rem;
}
.trust-bar strong {
    color: var(--text-color);
    font-weight: 700;
}

/* Comparison Section */
.comparison-section {
    text-align: center;
}
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    text-align: left;
}
.comparison-card {
    border-radius: var(--border-radius);
    padding: 2rem;
}
.comparison-card h3 {
    margin-top: 0;
    font-size: 1.5rem;
}
.comparison-card ul {
    list-style: none;
    padding: 0;
    font-size: 1.1rem;
    line-height: 2;
}
.old-way {
    background-color: #FEF2F2; /* Light Red */
    border: 1px solid #FCA5A5;
}
.new-way {
    background-color: #EFF6FF; /* Light Blue */
    border: 1px solid #BFDBFE;
}

/* How It Works Section */
.how-it-works-section {
    text-align: center;
    background-color: var(--card-bg);
}
.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
}
.how-it-works-step {
    padding: 1.5rem;
}
.step-number {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 auto 1.5rem;
    border: 5px solid #E0E7FF;
}

/* Testimonials Section */
.testimonials-section {
    background-color: var(--background-color);
    text-align: center;
}
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: left;
}
.testimonial-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}
.testimonial-card .stars {
    color: #FBBF24; /* Amber */
    font-size: 1.25rem;
    margin-bottom: 1rem;
}
.testimonial-card p {
    font-size: 1.1rem;
    color: var(--text-color-light);
    line-height: 1.8;
    flex-grow: 1;
}
.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}
.author-initials {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
}
.testimonial-author span {
    color: var(--text-color-light);
    font-size: 0.9rem;
}

/* ========================================================================= */
/* --- NEW: MOBILE RESPONSIVENESS --- */
/* These styles will ONLY apply to screens 768px wide or smaller (tablets/phones) */
/* ========================================================================= */
@media (max-width: 768px) {

    /* --- General Layout & Typography Adjustments --- */
    main {
        margin: 1.5rem auto; /* Reduce top/bottom space */
        padding: 0.5rem;       /* Reduce side padding */
    }

    h2 {
        font-size: 1.8rem; /* Slightly smaller headings on mobile */
    }

    .hero-text h2 {
        font-size: 2.5rem; /* Make the main landing page title smaller */
    }

    /* --- Header & Navigation Fix --- */
    header {
        flex-direction: column; /* Stack the logo and buttons vertically */
        gap: 1rem;
        padding: 1rem;
    }

    .nav-buttons {
        width: 100%;
        display: flex;
        justify-content: space-around; /* Evenly space the buttons */
    }

    /* --- Fix for all Button Grids --- */
    /* This targets the exam, year, and skill selection screens */
    .button-grid,
    .subscription-grid,
    .features-grid,
    .comparison-grid,
    .how-it-works-grid,
    .testimonials-grid {
        grid-template-columns: 1fr; /* Force all grids into a single column */
        gap: 1rem; /* Reduce the space between stacked items */
    }

    /* --- Test View Adjustments --- */
    #question-container,
    #writing-prompt-container,
    .page-content {
        padding: 1.5rem; /* Reduce padding inside the main content cards */
    }

    .question-text {
        font-size: 1.3rem; /* Make question text more readable on small screens */
    }

    /* Stack the "Ask Sparky" and "Submit" buttons vertically */
    .action-buttons {
        flex-direction: column-reverse; /* Puts primary button on bottom */
        gap: 1rem;
        align-items: stretch; /* Make buttons full-width */
    }

    /* --- Pricing Page Fixes --- */
    .plan-card.featured {
        transform: none; /* Remove the "zoom" effect on the featured plan */
    }

    .plan-card.featured:hover {
        transform: translateY(-6px); /* Restore a simpler hover effect */
    }

    /* --- Account Management Modal Fix --- */
    .account-details-grid {
        grid-template-columns: 1fr; /* Stack account details */
        text-align: center;
    }

    /* --- Chatbot Adjustments --- */
    #chatbot-container {
        bottom: 1rem;
        right: 1rem;
    }

    #chatbot-window {
        bottom: 70px; /* Give more space from the toggle button */
    }
}