/* ============================================================
   The-Classroom — Stylesheet
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
                 Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    color: #2d3436;
    line-height: 1.6;
    min-height: 100vh;
}

a { color: #1565c0; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Navigation --- */
.nav-bar {
    background: #1a237e;
    color: white;
    padding: 0 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}
.nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: white !important;
    text-decoration: none !important;
}
.nav-links { display: flex; gap: 0.25rem; flex-wrap: wrap; align-items: center; }
.nav-links a {
    color: rgba(255,255,255,0.85);
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.nav-links a:hover { background: rgba(255,255,255,0.15); text-decoration: none; color: white; }

/* --- Flash Messages --- */
.flash { padding: 0.75rem 1.5rem; text-align: center; font-weight: 500; }
.flash-success { background: #c8e6c9; color: #1b5e20; }
.flash-error { background: #ffcdd2; color: #b71c1c; }

/* --- Container --- */
.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem; min-height: 70vh; }

/* --- Hero --- */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
    background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #3949ab 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 2rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
.hero .tagline { font-size: 1.2rem; opacity: 0.9; margin-bottom: 0.5rem; }
.hero .hero-sub { opacity: 0.8; font-size: 0.95rem; }

/* --- Feature Grid --- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.feature-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-top: 4px solid #3949ab;
    transition: transform 0.2s;
}
.feature-card:hover { transform: translateY(-2px); }
.feature-card-link { text-decoration: none !important; color: inherit; cursor: pointer; display: block; }
.feature-card-link h3 { color: #1a237e; }
.feature-card-link:hover { text-decoration: none !important; box-shadow: 0 4px 16px rgba(46,125,50,0.2); transform: translateY(-2px); }
.feature-card h3 { margin-bottom: 0.5rem; color: #1a237e; }

/* --- CTA Bar --- */
.cta-bar { text-align: center; padding: 2rem; background: white; border-radius: 10px; margin-bottom: 1.5rem; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.cta-bar p { margin-bottom: 1rem; font-size: 1.1rem; }

/* --- Launch Notice --- */
.launch-notice { text-align: center; padding: 1rem; color: #666; font-size: 0.9rem; }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn-primary { background: #1a237e; color: white; }
.btn-primary:hover { background: #283593; }
.btn-secondary { background: #e8eaf6; color: #1a237e; }
.btn-secondary:hover { background: #c5cae9; }
.btn-danger { background: #c62828; color: white; }
.btn-danger:hover { background: #b71c1c; }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.btn-full { width: 100%; }

.btn-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }

/* --- Forms --- */
.form-card {
    max-width: 520px;
    margin: 2rem auto;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.form-card h1 { text-align: center; margin-bottom: 0.5rem; color: #1a237e; }
.form-card .subtitle { text-align: center; color: #666; margin-bottom: 1.5rem; }
.form-card label { display: block; margin-top: 1rem; margin-bottom: 0.3rem; font-weight: 600; font-size: 0.9rem; }
.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="number"],
.form-card input[type="date"],
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
    border-color: #3949ab;
    outline: none;
    box-shadow: 0 0 0 3px rgba(57,73,171,0.15);
}
.form-card textarea { resize: vertical; }
.form-card button[type="submit"] { margin-top: 1.25rem; }
.form-footer { text-align: center; margin-top: 1rem; color: #666; font-size: 0.9rem; }

/* Role Selection */
.role-select { display: flex; gap: 1rem; margin: 0.5rem 0; }
.role-option { flex: 1; cursor: pointer; }
.role-option input[type="radio"] { display: none; }
.role-card {
    display: block;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
}
.role-option input:checked + .role-card {
    border-color: #3949ab;
    background: #e8eaf6;
}
.role-card strong { display: block; font-size: 1.1rem; margin-bottom: 0.25rem; }
.role-card small { color: #666; }

.terms-check { display: flex; align-items: center; gap: 0.5rem; font-weight: normal !important; }
.terms-check input[type="checkbox"] { width: auto; }

/* --- Dashboard --- */
.dashboard-header { margin-bottom: 1.5rem; }
.dashboard-header h1 { color: #1a237e; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.dash-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.dash-card h3 { margin-bottom: 0.75rem; color: #1a237e; font-size: 1.1rem; }
.dash-card p { color: #444; }
.stats-row { display: flex; justify-content: space-around; text-align: center; padding: 1.5rem; }
.stat { font-size: 1.1rem; }
.stat strong { display: block; font-size: 2rem; color: #1a237e; }

/* --- Item Lists --- */
.item-list { list-style: none; }
.item-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.item-list li:last-child { border-bottom: none; }
.item-list small { color: #888; }

/* --- Empty State --- */
.empty-msg { color: #999; font-style: italic; padding: 1rem 0; text-align: center; }

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-active, .badge-lesson, .badge-graded { background: #c8e6c9; color: #1b5e20; }
.badge-pending, .badge-assigned, .badge-exercise { background: #fff3e0; color: #e65100; }
.badge-ended, .badge-submitted, .badge-resource { background: #e3f2fd; color: #0d47a1; }
.badge-draft { background: #f3e5f5; color: #6a1b9a; }
.badge-graded { background: #c8e6c9; color: #1b5e20; }
.badge-practice { background: #e8f5e9; color: #2e7d32; }
.badge-survey { background: #e3f2fd; color: #1565c0; }
.badge-free { background: #f5f5f5; color: #616161; }
.badge-basic { background: #e8f5e9; color: #2e7d32; }
.badge-premium { background: #fff8e1; color: #f9a825; }
.badge-contract, .badge-study_plan_doc { background: #fce4ec; color: #880e4f; }
.badge-certificate { background: #e8eaf6; color: #283593; }

/* --- Quick Links --- */
.quick-links { display: flex; gap: 0.75rem; flex-wrap: wrap; justify-content: center; margin: 1.5rem 0; }

/* --- Inline Form --- */
.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.75rem; }
.inline-form input[type="text"],
.inline-form input[type="email"],
.inline-form input[type="date"] {
    padding: 0.45rem 0.7rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

/* --- Module Content --- */
.module-content { line-height: 1.8; white-space: pre-wrap; }

/* --- Spacing Helpers --- */
.mb-sm { margin-bottom: 0.5rem; }
.mb-lg { margin-bottom: 1.5rem; }

/* --- Simple Table --- */
.simple-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.simple-table th, .simple-table td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid #eee; }
.simple-table th { font-weight: 600; color: #555; font-size: 0.85rem; }

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    color: #999;
    font-size: 0.85rem;
    border-top: 1px solid #e0e0e0;
    margin-top: 2rem;
}
.site-footer a { color: #666; }

/* --- Accordion --- */
.accordion { max-width: 800px; margin: 0 auto; }
.accordion-item { margin-bottom: 0.25rem; }
.accordion-header {
    width: 100%; text-align: left; padding: 0.75rem 1rem;
    background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 8px;
    font-size: 0.95rem; cursor: pointer; font-family: inherit;
    transition: background 0.2s;
}
.accordion-header:hover { background: #e8eaf6; }
.accordion-header.sub { font-size: 0.9rem; padding: 0.6rem 1rem 0.6rem 2rem; }
.accordion-header span { color: #888; font-weight: normal; }
.accordion-body { display: none; padding: 0.5rem 0 0.5rem 1.5rem; }
.accordion-item.open > .accordion-body { display: block; }
.accordion-item.open > .accordion-header {
    background: #e8eaf6; border-radius: 8px 8px 0 0;
}
.record-list { list-style: none; padding: 0; }
.record-list li {
    padding: 0.4rem 0.75rem; border-left: 3px solid #7b1fa2;
    margin-bottom: 0.3rem; background: #fafafa; border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
}

/* --- Billing Scroll --- */
.billing-scroll { max-height: 350px; overflow-y: auto; border: 1px solid #e0e0e0; border-radius: 8px; }
.billing-scroll table { margin: 0; }
.billing-scroll thead { position: sticky; top: 0; background: #fafafa; z-index: 1; }
.amount-paid { color: #c62828; font-weight: 600; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-inner { flex-direction: column; gap: 0.5rem; }
    .nav-links { justify-content: center; }
    .hero { padding: 2rem 1rem; }
    .hero h1 { font-size: 1.8rem; }
    .dash-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
}
