/* ==========================================================================
   Screen Styling for EDU HD Rooms Online Manual Hub
   Modern, Clean, Responsive with Role Themes & Lightbox
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600;700&display=swap');

:root {
    --font-heading: 'Prompt', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Theme Palette */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #ccfbf1;
    --primary-glow: rgba(13, 148, 136, 0.2);

    /* Role Specific Accents */
    --role-booker: #0d9488;
    --role-booker-bg: rgba(13, 148, 136, 0.08);
    --role-staff: #d97706;
    --role-staff-bg: rgba(217, 119, 6, 0.08);
    --role-head: #6366f1;
    --role-head-bg: rgba(99, 102, 241, 0.08);
    --role-dean: #e11d48;
    --role-dean-bg: rgba(225, 29, 72, 0.08);

    /* Neutrals */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-sub: #94a3b8;
    --border-color: #e2e8f0;
    --border-highlight: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 15px -2px rgba(0,0,0,0.08), 0 2px 6px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 35px -10px rgba(0,0,0,0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-main);
    background-color: var(--bg-main);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: var(--font-heading);
    color: #0f172a;
    font-weight: 600;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */
.manual-topbar {
    position: sticky;
    top: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1020;
    padding: 12px 24px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
}

.manual-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.manual-brand img {
    height: 42px;
    width: auto;
    object-fit: contain;
    border-radius: 6px;
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 2px 0 0 0;
}

.manual-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
}

.btn-action-primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-action-primary:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
    color: #ffffff;
}

.btn-action-outline {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-action-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-action-back {
    background: transparent;
    color: #cbd5e1;
}

.btn-action-back:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

/* ==========================================================================
   Hero Section & Search Filter Bar
   ========================================================================== */
.manual-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0d9488 160%);
    padding: 40px 24px 30px;
    color: #ffffff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.manual-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, var(--bg-main), transparent);
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.05rem;
    color: #cbd5e1;
    max-width: 720px;
    margin: 0 auto 25px;
}

/* Role Filter Pills */
.role-pills-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

.role-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #ffffff;
}

.role-pill.active {
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    border-color: #ffffff;
}

.role-pill[data-role="booker"].active {
    color: var(--role-booker);
    border-bottom: 3px solid var(--role-booker);
}

.role-pill[data-role="staff"].active {
    color: var(--role-staff);
    border-bottom: 3px solid var(--role-staff);
}

.role-pill[data-role="head_office"].active {
    color: var(--role-head);
    border-bottom: 3px solid var(--role-head);
}

.role-pill[data-role="dean"].active {
    color: var(--role-dean);
    border-bottom: 3px solid var(--role-dean);
}

/* Search Box */
.search-wrapper {
    max-width: 580px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1rem;
    font-family: var(--font-body);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-input:focus {
    outline: none;
    background: #ffffff;
    color: #0f172a;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.25);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.15rem;
    pointer-events: none;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.manual-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 30px 24px 60px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    align-items: start;
}

/* Floating Table of Contents Sidebar */
.toc-sidebar {
    position: sticky;
    top: 86px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.toc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-item {
    font-size: 0.88rem;
}

.toc-link {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.toc-link:hover {
    background: #f1f5f9;
    color: var(--text-main);
    transform: translateX(3px);
}

.toc-link.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
}

.toc-group-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    margin-top: 14px;
    margin-bottom: 4px;
    padding-left: 8px;
}

/* ==========================================================================
   Role Chapter & Section Styling
   ========================================================================== */
.manual-content {
    min-width: 0; /* Prevents overflow issues in grid */
}

.manual-role-chapter {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 36px;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.role-chapter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 24px;
    margin-bottom: 28px;
    border-bottom: 2px solid #f1f5f9;
}

.role-chapter-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.role-chapter-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: var(--shadow-sm);
}

.role-icon-booker { background: var(--role-booker-bg); color: var(--role-booker); }
.role-icon-staff { background: var(--role-staff-bg); color: var(--role-staff); }
.role-icon-head { background: var(--role-head-bg); color: var(--role-head); }
.role-icon-dean { background: var(--role-dean-bg); color: var(--role-dean); }

.role-chapter-title h2 {
    font-size: 1.6rem;
    margin: 0;
    line-height: 1.25;
}

.role-chapter-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

.role-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-booker { background: var(--role-booker-bg); color: var(--role-booker); border: 1px solid rgba(13, 148, 136, 0.2); }
.badge-staff { background: var(--role-staff-bg); color: var(--role-staff); border: 1px solid rgba(217, 119, 6, 0.2); }
.badge-head { background: var(--role-head-bg); color: var(--role-head); border: 1px solid rgba(99, 102, 241, 0.2); }
.badge-dean { background: var(--role-dean-bg); color: var(--role-dean); border: 1px solid rgba(225, 29, 72, 0.2); }

/* Section & Step Cards */
.manual-section {
    margin-bottom: 36px;
    scroll-margin-top: 90px;
}

.section-header {
    margin-bottom: 16px;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.manual-step-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.manual-step-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-highlight);
}

.step-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--primary);
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.step-desc {
    color: #334155;
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 14px;
}

/* ==========================================================================
   Mockup Containers & High-Res Vector Illustrations
   ========================================================================== */
.mockup-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    margin: 18px 0;
    text-align: center;
    position: relative;
    cursor: zoom-in;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.mockup-container:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.12);
}

.mockup-container svg,
.mockup-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.mockup-zoom-hint {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mockup-container:hover .mockup-zoom-hint {
    opacity: 1;
}

.mockup-caption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Numbered Callout Legend Table */
.callout-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
    margin-top: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
}

.callout-legend-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: #334155;
}

.callout-num-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ef4444;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ==========================================================================
   Callout Boxes (Tips, Warning, Requirements)
   ========================================================================== */
.callout-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 12px;
    margin: 16px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.callout-box i {
    font-size: 1.4rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.callout-box.tip {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 5px solid #22c55e;
    color: #166534;
}

.callout-box.warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-left: 5px solid #f59e0b;
    color: #92400e;
}

.callout-box.danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 5px solid #ef4444;
    color: #991b1b;
}

.callout-box.info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 5px solid #3b82f6;
    color: #1e40af;
}

/* ==========================================================================
   Workflow Infographic Cards
   ========================================================================== */
.workflow-stepper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.workflow-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.workflow-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.wf-step-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
}

.wf-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 10px auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.wf-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.wf-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   Export Modal & Lightbox
   ========================================================================== */
.export-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(6px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.export-modal-backdrop.show {
    display: flex;
    opacity: 1;
}

.export-modal-card {
    background: #ffffff;
    border-radius: 20px;
    max-width: 580px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header-custom {
    padding: 24px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header-custom h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1.25rem;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #ffffff;
}

.modal-body-custom {
    padding: 24px;
}

.export-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-item-card:hover {
    border-color: var(--primary);
    background: #f0fdfa;
    transform: translateX(4px);
}

.export-item-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.export-item-icon {
    font-size: 1.6rem;
}

.export-item-title {
    font-weight: 600;
    font-size: 0.98rem;
    color: #0f172a;
}

.export-item-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}

.lightbox-modal.show {
    display: flex;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background: #ffffff;
    padding: 10px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 991.98px) {
    .manual-wrapper {
        grid-template-columns: 1fr;
    }

    .toc-sidebar {
        display: none; /* Hide floating TOC on tablets/mobiles, show mobile TOC accordion if needed */
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .manual-role-chapter {
        padding: 24px;
    }
}

@media (max-width: 575.98px) {
    .manual-topbar {
        padding: 10px 16px;
    }

    .brand-text p {
        display: none;
    }

    .btn-action span {
        display: none;
    }

    .btn-action {
        padding: 8px 10px;
    }

    .role-pills-container {
        gap: 6px;
    }

    .role-pill {
        padding: 6px 12px;
        font-size: 0.82rem;
    }
}
