/* ═══════════════════════════════════════════════
   Speedy Teacher Platform — Frontend Styles
   ═══════════════════════════════════════════════ */

/* ── Variables ── */
:root {
    --stp-purple: #6d28d9;
    --stp-purple-light: #ede9fe;
    --stp-green: #16a34a;
    --stp-green-light: #dcfce7;
    --stp-amber: #d97706;
    --stp-red: #dc2626;
    --stp-gray: #64748b;
    --stp-border: #e2e8f0;
    --stp-bg: #f8fafc;
    --stp-white: #ffffff;
    --stp-radius: 12px;
    --stp-shadow: 0 2px 12px rgba(0,0,0,.07);
}

/* ── Base ── */
.stp-wrap, .stp-dashboard, .stp-register-wrap,
.stp-profile-page, .stp-teachers-list-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

/* ── Notices ── */
.stp-notice { padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-bottom: 14px; }
.stp-notice-ok    { background: var(--stp-green-light); color: #166534; border: 1.5px solid #86efac; }
.stp-notice-error { background: #fff5f5; color: #7f1d1d; border: 1.5px solid #fca5a5; }
.stp-notice-info  { background: #eff6ff; color: #1e40af; border: 1.5px solid #93c5fd; }

/* ── Buttons ── */
.stp-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 22px; border-radius: 8px; font-size: .9rem; font-weight: 600;
    text-decoration: none; cursor: pointer; border: none; font-family: inherit;
    transition: opacity .15s, transform .1s; white-space: nowrap;
}
.stp-btn:hover { opacity: .88; text-decoration: none; }
.stp-btn:active { transform: scale(.98); }
.stp-btn-primary { background: linear-gradient(135deg,#6d28d9,#7c3aed); color: #fff; }
.stp-btn-outline  { background: #fff; color: var(--stp-purple); border: 2px solid var(--stp-purple); }
.stp-btn-full { width: 100%; }
.stp-btn-enrol {
    padding: 8px 18px; font-size: .85rem;
    background: linear-gradient(135deg,#6d28d9,#7c3aed); color: #fff;
    border-radius: 7px; text-decoration: none; font-weight: 700;
    white-space: nowrap;
}
.stp-btn-enrol:hover { opacity: .9; color: #fff; text-decoration: none; }

/* ── Form elements ── */
.req { color: var(--stp-red); }
.stp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.stp-full { grid-column: 1 / -1; }
.stp-form-group { display: flex; flex-direction: column; gap: 5px; }
.stp-form-group label { font-size: .8rem; font-weight: 700; color: #475569; }
.stp-form-group input,
.stp-form-group select,
.stp-form-group textarea {
    padding: 9px 12px; border: 1.5px solid var(--stp-border); border-radius: 8px;
    font-size: .9rem; font-family: inherit; width: 100%; box-sizing: border-box;
    background: var(--stp-white); color: #1e293b; transition: border-color .15s;
}
.stp-form-group input:focus,
.stp-form-group select:focus,
.stp-form-group textarea:focus {
    outline: none; border-color: var(--stp-purple);
    box-shadow: 0 0 0 3px rgba(109,40,217,.1);
}

/* ── Subject checkboxes ── */
.stp-subject-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.stp-subject-cb { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.stp-subject-cb input { width: auto; }
.stp-subject-cb span {
    padding: 5px 12px; border: 1.5px solid var(--stp-border); border-radius: 20px;
    font-size: .82rem; transition: all .15s; user-select: none;
}
.stp-subject-cb input:checked + span {
    background: var(--stp-purple-light); border-color: var(--stp-purple); color: #4c1d95; font-weight: 700;
}

/* ── Registration card ── */
.stp-register-wrap { max-width: 660px; margin: 0 auto; padding: 0 16px; }
.stp-reg-card {
    background: var(--stp-white); border: 1.5px solid var(--stp-border);
    border-radius: var(--stp-radius); padding: 32px;
    box-shadow: var(--stp-shadow);
}
.stp-reg-header { text-align: center; margin-bottom: 24px; }
.stp-reg-icon { font-size: 2.5rem; margin-bottom: 10px; }
.stp-reg-header h2 { font-size: 1.5rem; margin: 0 0 6px; }
.stp-reg-header p { color: var(--stp-gray); margin: 0; }
.stp-reg-login { text-align: center; font-size: .85rem; color: var(--stp-gray); margin-top: 14px; }
.stp-reg-login a { color: var(--stp-purple); font-weight: 600; }

/* ── Dashboard ── */
.stp-dashboard { max-width: 980px; margin: 0 auto; }

.stp-dash-header {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--stp-white); border: 1.5px solid var(--stp-border);
    border-radius: var(--stp-radius); padding: 22px 26px; margin-bottom: 16px;
    flex-wrap: wrap; gap: 14px;
}
.stp-dash-teacher-info { display: flex; align-items: center; gap: 16px; }
.stp-dash-avatar {
    width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
    border: 3px solid var(--stp-purple-light);
}
.stp-dash-avatar-placeholder {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg,#6d28d9,#7c3aed); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 700; flex-shrink: 0;
}
.stp-dash-teacher-info h2 { font-size: 1.2rem; margin: 0 0 3px; }
.stp-dash-teacher-info p { margin: 0 0 4px; color: var(--stp-gray); font-size: .85rem; }
.stp-profile-link { font-size: .82rem; color: var(--stp-purple); font-weight: 600; text-decoration: none; }
.stp-profile-link:hover { text-decoration: underline; }

/* Stats row */
.stp-stats-row {
    display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-bottom: 16px;
}
.stp-stat-card {
    background: var(--stp-white); border: 1.5px solid var(--stp-border);
    border-radius: var(--stp-radius); padding: 16px; text-align: center;
}
.stp-stat-label { font-size: .72rem; font-weight: 700; color: var(--stp-gray); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stp-stat-value { font-size: 1.5rem; font-weight: 800; color: #0f172a; }
.stp-stat-value.stp-pending { color: var(--stp-amber); }

/* Tabs */
.stp-tabs {
    display: flex; gap: 4px; background: var(--stp-bg);
    border: 1.5px solid var(--stp-border); border-radius: var(--stp-radius);
    padding: 5px; margin-bottom: 16px; flex-wrap: wrap;
}
.stp-tab {
    padding: 9px 18px; border-radius: 8px; border: none; background: transparent;
    font-size: .88rem; font-weight: 600; color: var(--stp-gray); cursor: pointer;
    font-family: inherit; transition: all .15s;
}
.stp-tab.active { background: var(--stp-white); color: var(--stp-purple); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.stp-tab:hover:not(.active) { color: var(--stp-purple); }

.stp-tab-panel { display: none; }
.stp-tab-panel.active { display: block; }

/* Table */
.stp-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.stp-table th { text-align: left; padding: 10px 12px; font-size: .75rem; font-weight: 700; color: var(--stp-gray); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1.5px solid var(--stp-border); }
.stp-table td { padding: 11px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.stp-table tr:last-child td { border-bottom: none; }
.stp-table tr:hover td { background: #fafbfc; }

/* Badges */
.stp-badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .73rem; font-weight: 700; }
.stp-badge-online  { background: #dbeafe; color: #1d4ed8; }
.stp-badge-offline { background: #fce7f3; color: #9d174d; }

/* Courses grid in dashboard */
.stp-courses-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 12px; }
.stp-course-card {
    background: var(--stp-white); border: 1.5px solid var(--stp-border);
    border-radius: var(--stp-radius); padding: 16px;
    display: flex; align-items: flex-start; gap: 12px;
}
.stp-course-icon { font-size: 1.8rem; flex-shrink: 0; }
.stp-course-info { flex: 1; min-width: 0; }
.stp-course-title { font-weight: 700; font-size: .92rem; margin-bottom: 3px; }
.stp-course-meta { font-size: .78rem; color: var(--stp-gray); margin-bottom: 3px; }
.stp-course-earned { font-size: .78rem; color: var(--stp-green); font-weight: 700; }
.stp-course-edit { font-size: .78rem; color: var(--stp-purple); text-decoration: none; font-weight: 700; flex-shrink: 0; padding-top: 2px; }

/* Add student / profile forms */
.stp-add-student-form,
.stp-profile-form {
    background: var(--stp-white); border: 1.5px solid var(--stp-border);
    border-radius: var(--stp-radius); padding: 24px;
}
.stp-add-student-form h3,
.stp-profile-form h3 { font-size: 1.05rem; margin: 0 0 4px; }

.stp-empty { padding: 32px; text-align: center; color: var(--stp-gray); font-size: .9rem; }

/* ── Teacher public profile ── */
.stp-profile-page { max-width: 900px; margin: 0 auto; }

.stp-profile-hero {
    background: linear-gradient(135deg,#4c1d95,#6d28d9);
    border-radius: var(--stp-radius); padding: 36px 32px; margin-bottom: 24px; color: #fff;
}
.stp-profile-hero-inner { display: flex; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.stp-profile-photo {
    width: 110px; height: 110px; border-radius: 50%; object-fit: cover;
    border: 4px solid rgba(255,255,255,.3); flex-shrink: 0;
}
.stp-profile-photo-placeholder {
    width: 110px; height: 110px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,255,255,.2); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; font-weight: 700; border: 4px solid rgba(255,255,255,.3);
}
.stp-profile-photo-wrap { flex-shrink: 0; }
.stp-profile-hero-info { flex: 1; min-width: 200px; }
.stp-profile-hero-info h1 { font-size: 1.9rem; margin: 0 0 6px; color: #fff; }
.stp-profile-location { margin: 0 0 10px; opacity: .85; font-size: .92rem; }
.stp-profile-subjects { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.stp-subject-pill {
    background: rgba(255,255,255,.2); color: #fff; border-radius: 20px;
    padding: 3px 12px; font-size: .78rem; font-weight: 600;
}
.stp-profile-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: .88rem; opacity: .9; }

.stp-profile-body { padding: 0 4px; }
.stp-profile-section { margin-bottom: 28px; }
.stp-profile-section h2 { font-size: 1.15rem; font-weight: 800; margin: 0 0 12px; color: #0f172a; }
.stp-profile-bio { color: #334155; font-size: .95rem; }

/* Profile course cards */
.stp-profile-courses { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 14px; }
.stp-pcourse-card {
    background: var(--stp-white); border: 1.5px solid var(--stp-border);
    border-radius: var(--stp-radius); padding: 18px; display: flex; gap: 14px;
    transition: box-shadow .2s, border-color .2s;
}
.stp-pcourse-card:hover { box-shadow: 0 4px 20px rgba(109,40,217,.1); border-color: #c4b5fd; }
.stp-pcourse-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.stp-pcourse-details { flex: 1; min-width: 0; }
.stp-pcourse-details h3 { font-size: .97rem; font-weight: 700; margin: 0 0 5px; color: #0f172a; }
.stp-pcourse-details p { font-size: .83rem; color: var(--stp-gray); margin: 0 0 12px; }
.stp-pcourse-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stp-pcourse-price { display: flex; align-items: baseline; gap: 6px; }
.stp-price { font-size: 1.1rem; font-weight: 800; color: var(--stp-purple); }
.stp-price-old { font-size: .85rem; color: #94a3b8; text-decoration: line-through; }
.stp-price-free { font-size: 1rem; font-weight: 800; color: var(--stp-green); }

/* ── Teachers listing ── */
.stp-teachers-list-page { max-width: 980px; margin: 0 auto; }
.stp-list-header { text-align: center; margin-bottom: 24px; }
.stp-list-header h1 { font-size: 1.9rem; margin: 0 0 6px; }
.stp-list-header p { color: var(--stp-gray); margin: 0; }

.stp-filter-bar {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
    background: var(--stp-white); border: 1.5px solid var(--stp-border);
    border-radius: var(--stp-radius); padding: 14px 18px; margin-bottom: 20px;
}
.stp-filter-input {
    flex: 1; min-width: 180px; padding: 8px 12px;
    border: 1.5px solid var(--stp-border); border-radius: 7px; font-size: .88rem;
}
.stp-filter-select {
    padding: 8px 12px; border: 1.5px solid var(--stp-border);
    border-radius: 7px; font-size: .88rem; background: #fff;
}
.stp-results-count { color: var(--stp-gray); font-size: .85rem; margin-bottom: 14px; }

.stp-teachers-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
.stp-teacher-card {
    background: var(--stp-white); border: 1.5px solid var(--stp-border);
    border-radius: var(--stp-radius); padding: 20px; display: flex; gap: 14px;
    text-decoration: none; color: inherit;
    transition: box-shadow .2s, border-color .2s, transform .15s;
}
.stp-teacher-card:hover {
    box-shadow: 0 6px 24px rgba(109,40,217,.12); border-color: #c4b5fd;
    transform: translateY(-2px); text-decoration: none; color: inherit;
}
.stp-tc-photo { flex-shrink: 0; }
.stp-tc-photo img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.stp-tc-photo-placeholder {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg,#6d28d9,#7c3aed); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700;
}
.stp-tc-body { flex: 1; min-width: 0; }
.stp-tc-body h3 { font-size: .97rem; font-weight: 700; margin: 0 0 3px; color: #0f172a; }
.stp-tc-location { font-size: .8rem; color: var(--stp-gray); margin: 0 0 7px; }
.stp-tc-subjects { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.stp-tc-subjects span {
    background: var(--stp-purple-light); color: #4c1d95;
    font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 20px;
}
.stp-tc-stats { font-size: .78rem; color: var(--stp-gray); margin-bottom: 4px; }
.stp-tc-courses { font-size: .78rem; color: var(--stp-green); font-weight: 700; }
.stp-tc-arrow { align-self: center; font-size: 1.2rem; color: var(--stp-purple); flex-shrink: 0; }

.stp-empty-list { text-align: center; padding: 48px 24px; color: var(--stp-gray); }

/* ── Responsive ── */
@media (max-width: 640px) {
    .stp-stats-row { grid-template-columns: repeat(3,1fr); }
    .stp-form-grid { grid-template-columns: 1fr; }
    .stp-profile-hero { padding: 24px 18px; }
    .stp-profile-hero-inner { flex-direction: column; align-items: center; text-align: center; }
    .stp-profile-stats { justify-content: center; }
    .stp-dash-header { flex-direction: column; }
    .stp-teachers-grid { grid-template-columns: 1fr; }
    .stp-profile-courses { grid-template-columns: 1fr; }
    .stp-filter-bar { flex-direction: column; }
    .stp-filter-input, .stp-filter-select { width: 100%; }
    .stp-reg-card { padding: 20px; }
    .stp-tabs { gap: 2px; }
    .stp-tab { padding: 8px 12px; font-size: .8rem; }
}

/* ── Teacher Login ── */
.stp-teacher-login-wrap { max-width: 440px; margin: 40px auto; padding: 0 16px; }
.stp-login-card { background: var(--stp-white); border: 1.5px solid var(--stp-border); border-radius: var(--stp-radius); padding: 36px; box-shadow: var(--stp-shadow); }
.stp-login-header { text-align: center; margin-bottom: 24px; }
.stp-login-icon { font-size: 2.4rem; margin-bottom: 10px; }
.stp-login-header h2 { font-size: 1.4rem; margin: 0 0 5px; color: var(--stp-purple); }
.stp-login-header p  { color: var(--stp-gray); margin: 0; font-size: .88rem; }
.stp-login-form { display: flex; flex-direction: column; gap: 14px; }
.stp-btn-teacher-login { width: 100%; padding: 12px; background: linear-gradient(135deg,#6d28d9,#7c3aed); color: #fff; border: none; border-radius: 8px; font-size: .97rem; font-weight: 700; cursor: pointer; font-family: inherit; margin-top: 8px; }
.stp-btn-teacher-login:hover { opacity: .9; }
.stp-login-footer { text-align: center; font-size: .83rem; color: var(--stp-gray); margin-top: 14px; margin-bottom: 0; }
.stp-login-footer a { color: var(--stp-purple); font-weight: 600; }
