/* =========================================================
   Legacy LMS – Single Stylesheet (style.css)
   Sections:
   1. Base / Global
   2. Layout / Containers
   3. Header, Navigation & Footer
   4. Buttons & Utilities
   5. Public Landing (index.php)
   6. Login Modal
   7. Learner Dashboard
   8. Manager Dashboard
   9. Responsive tweaks
   ========================================================= */

/* ===========================
   1. Base / Global
   =========================== */

:root {
    --legacy-pink: #ed5a96;
    --legacy-pink-soft: #fbe2ef;
    --legacy-navy: #1b2140;
    --legacy-grey: #6b7280;
    --legacy-bg: #f5f5f7;
    --legacy-border: #e5e7eb;
    --legacy-success: #16a34a;
    --legacy-warning: #f59e0b;
    --legacy-danger: #dc2626;
    --radius-card: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111827;
    background-color: var(--legacy-bg);
}

a {
    color: var(--legacy-pink);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

main {
    min-height: 70vh;
}

/* Simple container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

/* ===========================
   3. Header, Navigation & Footer
   =========================== */

/* Global header */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--legacy-border);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 40;
}

.site-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

/* Left side: Logo only */
.site-header-brand-left {
    display: flex;
    align-items: center;
}

.site-header-logo-link {
    display: inline-flex;
    align-items: center;
}

/* Slightly smaller logo */
.site-header-logo {
    height: 50px;
    width: auto;
    display: block;
}

/* Right side: user pill + nav stacked */
.site-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 0.8rem;
}

/* User pill – name + role/company */
.site-header-titlebar {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.30rem 0.75rem;
    border-radius: 999px;
    background: #f9fafb;
    border: 1px solid var(--legacy-border);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
    font-size: 0.85rem;
}

/* User name */
.site-header-username {
    color: var(--legacy-navy);
    font-weight: 600;
}

/* Legacy tagline/title classes kept (not currently used but safe to keep) */
.site-header-tagline {
    color: var(--legacy-grey);
    font-weight: 400;
}

.site-header-title {
    color: var(--legacy-navy);
    font-weight: 700;
}

/* Inline role / company switchers */

.role-switch-form-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
}

.role-switch-label-inline {
    font-size: 0.75rem;
    color: var(--legacy-grey);
}

.role-switch-select-inline {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--legacy-border);
    background: #ffffff;
    color: #111827;
}

/* Legacy block role switcher (kept for compatibility if used elsewhere) */
.role-switch-form {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--legacy-grey);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.role-switch-label {
    font-size: 0.8rem;
}

.role-switch-select {
    font-size: 0.8rem;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--legacy-border);
    background: #ffffff;
}

/* Navigation under user pill */

.site-nav {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.site-nav-list {
    list-style: none;
    display: flex;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
}

/* Modern pill-style nav items */
.site-nav-link {
    font-size: 0.92rem;
    color: #374151;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    background: transparent;
    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.site-nav-link:hover {
    color: var(--legacy-pink);
    background: var(--legacy-pink-soft);
    border-color: var(--legacy-pink-soft);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    text-decoration: none;
}

/* Logout link with danger colour */
.site-nav-link--logout {
    color: var(--legacy-danger);
}

.site-nav-link--logout:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--legacy-danger);
    box-shadow: 0 4px 10px rgba(185, 28, 28, 0.16);
    text-decoration: none !important;
}

/* Highlight current page */
.site-nav-link.active {
    color: var(--legacy-pink);
    font-weight: 600;
    background: var(--legacy-pink-soft);
    border-color: var(--legacy-pink);
    box-shadow: 0 4px 12px rgba(237, 90, 150, 0.18);
    text-decoration: none !important;
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--legacy-border);
    padding: 1.5rem 1.25rem;
    font-size: 0.85rem;
    color: var(--legacy-grey);
    background: #ffffff;
}

.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===========================
   4. Buttons & Utilities
   =========================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: var(--legacy-pink);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(237, 90, 150, 0.3);
}

.btn-primary:hover {
    background: #d94884;
    box-shadow: 0 10px 22px rgba(237, 90, 150, 0.4);
}

.btn-outline {
    background: #ffffff;
    color: var(--legacy-navy);
    border-color: var(--legacy-border);
}

.btn-outline:hover {
    border-color: var(--legacy-pink);
    color: var(--legacy-pink);
}

.text-muted {
    color: var(--legacy-grey);
}

.mt-2 {
    margin-top: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

/* Cards & grids */

.card {
    background: #ffffff;
    border-radius: var(--radius-card);
    border: 1px solid var(--legacy-border);
    padding: 1.5rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.role-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 190px;
}

.role-label {
    display: inline-flex;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: var(--legacy-pink-soft);
    color: var(--legacy-pink);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

/* ===========================
   5. Public Landing (index.php)
   =========================== */

/* Full-width hero */

.hero-full {
    margin-bottom: 2rem;
}

.hero-banner {
    position: relative;
    width: 100%;
    max-height: 460px;
    overflow: hidden;
}

.hero-banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top; /* nudges the subject up a little */
    display: block;
}

/* Overlay text */

.hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    pointer-events: none;
}

.hero-overlay-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem;
    width: 100%;
    display: flex;
    justify-content: flex-start;
}

.hero-overlay-box {
    max-width: 520px;
    background: rgba(255, 255, 255, 0.40); /* slightly transparent */
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
}

.hero-overlay-box h1 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.7rem;
    color: var(--legacy-navy);
}

.hero-overlay-box p {
    margin: 0.25rem 0;
    font-size: 0.95rem;
    color: #374151;
}

/* ===========================
   6. Login Modal (global)
   =========================== */

#loginModal {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.65);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loginModal .modal-box {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 380px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    position: relative;
    margin: 0 auto;
}

#loginModal label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.75rem;
    margin-bottom: 0.2rem;
    color: #374151;
}

#loginModal input[type="email"],
#loginModal input[type="password"] {
    width: 100%;
    padding: 0.45rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--legacy-border);
    font-size: 0.9rem;
}

#loginModal input:focus {
    outline: none;
    border-color: var(--legacy-pink);
    box-shadow: 0 0 0 1px rgba(237, 90, 150, 0.2);
}

#loginModal .modal-close {
    background: transparent;
    border: none;
    margin-top: 1rem;
    color: var(--legacy-grey);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
}

/* ===========================
   7. Learner Dashboard
   =========================== */

.learner-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.learner-dashboard h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.learner-dashboard-subtitle {
    color: var(--legacy-grey);
    margin-bottom: 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-card);
    border: 1px solid var(--legacy-border);
    padding: 1.25rem;
}

.stat-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--legacy-pink);
}

.stat-meta {
    font-size: 0.85rem;
    color: var(--legacy-grey);
}

/* Progress bar example */

.progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar-inner {
    height: 100%;
    width: 60%;
    background: var(--legacy-pink);
}

/* Course list */

.course-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.course-card {
    background: #ffffff;
    border-radius: var(--radius-card);
    border: 1px solid var(--legacy-border);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.course-title {
    font-weight: 600;
    margin: 0;
}

.course-meta {
    font-size: 0.85rem;
    color: var(--legacy-grey);
}

.course-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    gap: 0.35rem;
}

.course-status-pill--inprogress {
    background: #eef2ff;
    color: #3730a3;
}

.course-status-pill--completed {
    background: #ecfdf3;
    color: #166534;
}

/* Course layout (course_view.php – sidebar + main content) */

.course-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 1.5rem;
}

.course-layout-aside {
    flex: 0 0 280px;
    max-width: 280px;
}

.course-layout-main {
    flex: 1 1 0;
    min-width: 0;
}

/* ===========================
   8. Manager Dashboard
   =========================== */

.manager-dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.manager-dashboard h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.manager-dashboard-subtitle {
    color: var(--legacy-grey);
    margin-bottom: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: #ffffff;
    border-radius: var(--radius-card);
    border: 1px solid var(--legacy-border);
    padding: 1.25rem;
}

.summary-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.summary-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--legacy-navy);
}

.summary-tagline {
    font-size: 0.85rem;
    color: var(--legacy-grey);
}

/* Table */

.manager-table-card {
    background: #ffffff;
    border-radius: var(--radius-card);
    border: 1px solid var(--legacy-border);
    padding: 1.25rem 1.5rem;
    overflow-x: auto;
}

.manager-table-card h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid var(--legacy-border);
    text-align: left;
}

.table th {
    font-weight: 600;
    color: var(--legacy-grey);
    background: #f9fafb;
}

.badge {
    display: inline-flex;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

.badge-success {
    background: #ecfdf3;
    color: #15803d;
}

.badge-warning {
    background: #fffbeb;
    color: #b45309;
}

.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
}

/* ===========================
   9. Responsive tweaks
   =========================== */

@media (max-width: 768px) {
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .site-header-right {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    .site-nav {
        align-items: flex-start;
        width: 100%;
    }

    .site-nav-list {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .hero-banner {
        max-height: 360px;
    }

    .hero-overlay-inner {
        justify-content: center;
    }

    .hero-overlay-box {
        max-width: 100%;
        padding: 1.25rem 1.4rem;
    }

    /* Course layout – stack sidebar below main content on small screens */
    .course-layout {
        flex-direction: column;
    }

    .course-layout-main {
        order: 1;
        min-width: 0;
    }

    .course-layout-aside {
        order: 2;
        flex: 1 1 100%;
        max-width: 100%;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .site-header-logo {
        height: 56px;
    }

    .container {
        padding: 1.5rem 1rem 2.5rem;
    }
}