/* =========================================
   Global Reset & Base
   ========================================= */

html {
    scroll-behavior: smooth;
}

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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.05rem;
    line-height: 1.7;
    background: #f3f4f6;
    color: #111827;
}

/* =========================================
   Top Navigation (aligned with style.css)
   ========================================= */

.top-nav {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: rgba(229, 231, 235, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.6);
}

.top-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.top-nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.ucy-logo {
    height: 36px;
    width: auto;
    display: block;
}

.site-nav ul li a {
    font-size: clamp(1.15rem, 3vw, 1.4rem);
    line-height: 1.4;
}

.top-nav-title {
    font-size: clamp(1.2rem, 2.4vw, 1.5rem);
    font-weight: 600;
    color: #111827;
}

.top-nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: clamp(1.15rem, 3vw, 1.4rem);
    line-height: 1.4;
}

.top-nav-links a {
    font-size: 1.05rem;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    position: relative;
}

.top-nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.25rem;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #6366f1);
    border-radius: 999px;
    transition: width 0.2s ease;
}

.top-nav-links a:hover,
.top-nav-links a:focus-visible {
    color: #111827;
}

.top-nav-links a:hover::after,
.top-nav-links a:focus-visible::after {
    width: 100%;
}

/* =========================================
   Mobile Navigation Toggle
   ========================================= */

.nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    margin-left: auto;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background-color: #111827;
    margin: 4px 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 1200px) {
    .site-nav {
        position: absolute;
        inset-inline: 0;
        top: 100%;
        background-color: rgba(229, 231, 235, 0.98);
        border-bottom: 1px solid rgba(148, 163, 184, 0.6);
        transform-origin: top;
        transform: scaleY(0.8);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.15s ease, transform 0.15s ease;
    }

    .site-nav.open {
        opacity: 1;
        pointer-events: auto;
        transform: scaleY(1);
    }

    .site-nav ul {
        display: flex;
        flex-direction: column;
        padding: 0.75rem 1.5rem 1.25rem;
        gap: 0.9rem;
    }

    .nav-toggle {
        display: inline-block;
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

/* =========================================
   Page Container
   ========================================= */

.course-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

/* =========================================
   Course Hero / Header
   ========================================= */

.course-hero {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    width: 100%;
    padding: 1rem 0 1.4rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.course-hero-inner {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto;
    padding: 0 1rem;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 1rem;
}

.course-hero-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.course-title {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: #ffffff;
    font-weight: 700;
    line-height: 1.2;
}

/* Breadcrumb region */
.region-breadcrumb {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.25rem;
    padding: 0.1rem 0;
}

.region-breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.15s ease;
}

.region-breadcrumb a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.region-breadcrumb span {
    color: #ffffff;
    font-weight: 500;
}

.course-subtitle {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-top: 0.1rem;
    font-weight: 400;
}

/* Badges */
.course-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
    justify-content: flex-end;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid rgba(249, 250, 251, 0.4);
}

.badge-level {
    background: rgba(16, 185, 129, 0.25);
}

.badge-type {
    background: rgba(199, 9, 129, 0.25);
}

.badge-type-compulsory {
    background: rgba(199, 9, 129, 0.25);
}

.badge-type-restricted {
    background: rgba(255, 223, 100, 0.25);
}

.badge-code {
    background: rgba(59, 130, 246, 0.25);
}

/* =========================================
   Top Info Cards (new)
   ========================================= */

.course-top-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.course-top-info .card {
    background: #ffffff;
    border-radius: 0.85rem;
    padding: 1rem 1.1rem;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
    border-left: 4px solid #2563eb;
}

.course-top-info .card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    color: #111827;
}

.course-top-info .card p,
.course-top-info .card ul {
    font-size: 1rem;
    color: #374151;
}

.course-top-info .card-person-body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.course-top-info .profile-photo {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
}

/* Syllabus download card (top info) */
.card-syllabus-top .syllabus-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: #f3f4ff;
    border: 1px solid #c7d2fe;
    font-size: 0.95rem;
    color: #1d4ed8;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.1s ease,
                box-shadow 0.15s ease, border-color 0.15s ease;
}
.card-syllabus-top .syllabus-download:hover,
.card-syllabus-top .syllabus-download:focus-visible {
    background: #e0e7ff;
    border-color: #818cf8;
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.18);
    transform: translateY(-1px);
    color: #2563eb;
}

.meta-list {
    list-style: none;
}

.meta-list li + li {
    margin-top: 0.25rem;
}

/* =========================================
   Main Layout (full width)
   ========================================= */

.course-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-top: 0.5rem;
}

/* =========================================
   Main Content
   ========================================= */

.course-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Sections */
.section {
    background: #ffffff;
    border-radius: 0.85rem;
    padding: 1.25rem 1.4rem;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.05);
    border: 1px solid #e5e7eb;
}

/* ----- Section title: color #003366 and larger font ----- */
.section h2 {
    font-size: 1.6rem;                /* increased from 1.3rem */
    margin-bottom: 0.75rem;
    color: #003366;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section h2 i {
    color: #2563eb;
    font-size: 1.6rem;
    width: 1.8rem;
    text-align: center;
}

.section p {
    font-size: 1.05rem;
}

.section p + p {
    margin-top: 0.5rem;
}

/* ----- Content list with arrow icon (instead of checkmark) ----- */
.content-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0.75rem;
}

.content-list li {
    font-size: 1.05rem;
    padding: 0.3rem 0 0.3rem 1.8rem;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="%230d6efd" d="M6.5 3.5L12 8l-5.5 4.5V3.5z"/></svg>') left center no-repeat;
    background-size: 1.1rem;
}

.content-list li + li {
    margin-top: 0.4rem;
}

.content-list strong {
    color: #111827;
}

/* =========================================
   Schedule List - spacing between items
   ========================================= */

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

/* =========================================
   Schedule Item - Flex layout for PDF on right
   ========================================= */

.schedule-item {
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 0.75rem 1.2rem;
    background: #f9fafb;
    border-left: 4px solid #2563eb;
    display: flex;
    flex-direction: column;
}

.schedule-item .schedule-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.schedule-item .schedule-text {
    flex: 1;
    min-width: 200px;
}

.schedule-item .schedule-pdf {
    flex-shrink: 0;
    margin-top: 0.25rem;
}

/* Topic badge (blue highlight) */
.topic-badge {
    display: inline-block;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Recitation override */
.schedule-item--recitation {
    background: #ecfeff;
    border-color: #06b6d4;
    border-left-color: #06b6d4;
}

.schedule-item--recitation .topic-badge {
    background: #cffafe;
    color: #0891b2;
}

/* Numbering for lectures */
.schedule-list--lectures {
    counter-reset: lecture;
}

.schedule-list--lectures .schedule-item:not(.schedule-item--recitation) .lecture-number::before {
    counter-increment: lecture;
    content: counter(lecture) ". ";
    font-weight: 600;
    margin-right: 0.25rem;
    color: #111827;
}

.schedule-list--lectures .schedule-item--recitation .lecture-number::before {
    content: none;
}

/* Numbering for labs */
.schedule-list--labs {
    counter-reset: lab;
}

.schedule-list--labs .schedule-item .lab-number::before {
    counter-increment: lab;
    content: counter(lab) ". ";
    font-weight: 600;
    margin-right: 0.25rem;
    color: #111827;
}

/* =========================================
   PDF button (right-aligned)
   ========================================= */

.pdf-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    background: #f3f4ff;
    border: 1px solid #c7d2fe;
    font-size: 0.85rem;
    color: #1d4ed8;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.1s ease,
                box-shadow 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
}

.pdf-button:hover,
.pdf-button:focus-visible {
    background: #e0e7ff;
    border-color: #818cf8;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
    color: #2563eb;
}

.pdf-button i {
    font-size: 0.9rem;
}

/* =========================================
   Syllabus Download Button (inside content)
   ========================================= */

.syllabus-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    background: #1d4ed8;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
    margin-top: 0.75rem;
}

.syllabus-download-btn:hover,
.syllabus-download-btn:focus-visible {
    background: #2563eb;
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.3);
    transform: translateY(-1px);
    color: #ffffff;
    text-decoration: none;
}

.syllabus-download-btn i {
    font-size: 1.1rem;
}

/* =========================================
   Lab Info Boxes (replaces Bootstrap card-body)
   ========================================= */

.lab-info-box {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.5rem 1.8rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.lab-info-box .lab-info-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lab-info-box .lab-info-item:last-child {
    margin-bottom: 0;
}

.lab-info-box .lab-info-icon {
    font-size: 2rem;
    color: #0d6efd;
    flex-shrink: 0;
    width: 2.5rem;
    text-align: center;
}

.lab-info-box .lab-info-icon.text-success {
    color: #198754;
}

.lab-info-box .lab-info-icon.text-dark {
    color: #212529;
}

.lab-info-box .lab-info-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #212529;
}

.lab-info-box .lab-info-text a {
    color: #0d6efd;
    text-decoration: underline;
}

.lab-info-box .lab-info-text a:hover {
    color: #0a58ca;
}

.lab-info-box .lab-info-alert {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem 1.25rem;
    margin-top: 1rem;
}

/* =========================================
   Lab Table (matches target site)
   ========================================= */

.lab-table {
    border-collapse: collapse;
    font-size: 1.05rem;               /* same as body */
    width: 100%;
}

.lab-table th {
    background-color: #e9ecef;
    color: #003366;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.lab-table td {
    padding: 0.6rem 0.75rem;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

/* Center the Week column */
.lab-table td:first-child,
.lab-table th:first-child {
    text-align: center;
}

.lab-table tbody tr:hover {
    background-color: #f8f9ff;
}

.lab-table .pdf-button {
    font-size: 0.85rem;
    padding: 0.15rem 0.6rem;
}

/* =========================================
   Bibliography
   ========================================= */

.bibliography {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bibliography li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.book-cover {
    width: 52px;
    height: auto;
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
}

.bibliography-text {
    font-size: 1rem;
    color: #374151;
}

/* =========================================
   Links & Person Links
   ========================================= */

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
    color: #2563eb;
    text-decoration: none;
}

/* Person links */
.person-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.person-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                transform 0.1s ease, box-shadow 0.15s ease;
}

.person-link:hover,
.person-link:focus-visible {
    background-color: #e5e7eb;
    border-color: #d1d5db;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
    transform: translateY(-1px);
    color: #2563eb;
}

.person-icon {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* =========================================
   Site Footer
   ========================================= */

.site-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1rem 2rem;
    margin-top: 2rem;
    background: #f9fafb;
    font-size: 0.95rem;
    color: #6b7280;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.site-footer a {
    font-weight: 500;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #2563eb;
}

/* =========================================
   Responsive Tweaks
   ========================================= */

@media (max-width: 1200px) {
    .course-top-info {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .course-title {
        font-size: 2.4rem;
    }

    .course-page {
        padding: 0 0.75rem 2.5rem;
    }

    .badge {
        font-size: 0.85rem;
        padding: 0.25rem 0.6rem;
    }

    .lab-table {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .course-hero-inner {
        padding: 0 0.75rem;
    }

    .course-title {
        font-size: 2.0rem;
    }

    .course-subtitle {
        font-size: 1.2rem;
    }

    .section {
        padding: 1rem 1rem;
    }

    .course-top-info {
        grid-template-columns: 1fr;
    }

    body {
        font-size: 1.12rem;
    }

    .schedule-item .schedule-content {
        flex-direction: column;
        align-items: stretch;
    }

    .schedule-item .schedule-pdf {
        align-self: flex-start;
    }

    .lab-table th,
    .lab-table td {
        padding: 0.4rem 0.5rem;
        font-size: 0.9rem;
    }

    .lab-info-box {
        padding: 1rem;
    }

    .lab-info-box .lab-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .lab-info-box .lab-info-icon {
        font-size: 1.6rem;
        width: auto;
    }
}

/* Mobile: even larger + easier to tap */
@media (max-width: 1200px) {
    .top-nav-links a,
    .site-nav ul li a {
        font-size: clamp(1.25rem, 4.5vw, 1.6rem);
        padding-block: 0.4rem;
        display: block;
    }

    .top-nav {
        padding-block: 0.7rem;
    }

    .top-nav-inner {
        padding: 0.8rem 1.1rem;
        gap: 1.2rem;
    }

    .ucy-logo {
        height: 48px;
    }

    .top-nav-title {
        font-size: 1.45rem;
        line-height: 1.4;
    }

    .nav-toggle {
        transform: scale(1.25);
    }

    .nav-toggle-bar {
        height: 3px;
    }
}