/* ──────────────────────────────────────────────────────────
 * OTS LMS — Layouts
 * v3.0.0
 * ────────────────────────────────────────────────────────── */

/* ═══════ SITE HEADER ═══════ */
.ots-header {
    position: sticky;
    top: 0;
    z-index: var(--ots-z-header);
    background: var(--ots-white);
    border-bottom: var(--ots-border);
    transition: box-shadow var(--ots-transition);
}
.ots-header.is-scrolled {
    box-shadow: var(--ots-shadow-sm);
}
.ots-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--ots-space-6);
    height: 64px;
    max-width: var(--ots-container-xl);
    margin: 0 auto;
}
.ots-header__logo {
    display: flex;
    align-items: center;
    gap: var(--ots-space-3);
    text-decoration: none;
}
.ots-header__logo img {
    height: 36px;
    width: auto;
}
.ots-header__logo-text {
    font-size: var(--ots-text-lg);
    font-weight: 800;
    color: var(--ots-primary);
}

.ots-header__nav {
    display: flex;
    align-items: center;
    gap: var(--ots-space-1);
}
.ots-header__nav-link {
    padding: var(--ots-space-2) var(--ots-space-3);
    font-size: var(--ots-text-sm);
    font-weight: 500;
    color: var(--ots-gray-600);
    text-decoration: none;
    border-radius: var(--ots-radius);
    transition: all var(--ots-transition);
}
.ots-header__nav-link:hover,
.ots-header__nav-link.active {
    color: var(--ots-primary);
    background: var(--ots-primary-50);
}

.ots-header__actions {
    display: flex;
    align-items: center;
    gap: var(--ots-space-3);
}
.ots-header__search-toggle,
.ots-header__notifications {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: var(--ots-radius-full);
    color: var(--ots-gray-600);
    cursor: pointer;
    transition: all var(--ots-transition);
    position: relative;
}
.ots-header__search-toggle:hover,
.ots-header__notifications:hover {
    background: var(--ots-gray-100);
    color: var(--ots-gray-800);
}
.ots-header__notifications .ots-badge-count {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: var(--ots-danger);
    color: var(--ots-white);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--ots-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile toggle */
.ots-header__mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--ots-gray-700);
}


/* ═══════ SITE FOOTER ═══════ */
.ots-footer {
    background: var(--ots-gray-900);
    color: var(--ots-gray-400);
    padding: var(--ots-space-16) 0 var(--ots-space-6);
}
.ots-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--ots-space-10);
    max-width: var(--ots-container-xl);
    margin: 0 auto;
    padding: 0 var(--ots-space-6);
}
.ots-footer__brand p {
    font-size: var(--ots-text-sm);
    line-height: 1.6;
    margin-top: var(--ots-space-4);
    color: var(--ots-gray-400);
}
.ots-footer__heading {
    font-size: var(--ots-text-base);
    font-weight: 700;
    color: var(--ots-white);
    margin-bottom: var(--ots-space-4);
}
.ots-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ots-footer__links li {
    margin-bottom: var(--ots-space-2);
}
.ots-footer__links a {
    font-size: var(--ots-text-sm);
    color: var(--ots-gray-400);
    text-decoration: none;
    transition: color var(--ots-transition);
}
.ots-footer__links a:hover {
    color: var(--ots-white);
}
.ots-footer__bottom {
    margin-top: var(--ots-space-12);
    padding-top: var(--ots-space-6);
    border-top: 1px solid var(--ots-gray-800);
    text-align: center;
    font-size: var(--ots-text-sm);
    max-width: var(--ots-container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--ots-space-6);
    padding-right: var(--ots-space-6);
}


/* ═══════ DASHBOARD LAYOUT ═══════ */
.ots-dashboard {
    display: flex;
    min-height: calc(100vh - 64px);
    background: var(--ots-gray-50);
}
.ots-dashboard__sidebar {
    width: 260px;
    background: var(--ots-white);
    border-right: var(--ots-border);
    padding: var(--ots-space-6) 0;
    flex-shrink: 0;
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    scrollbar-width: thin;
}
.ots-dashboard__sidebar-header {
    padding: 0 var(--ots-space-5) var(--ots-space-5);
    border-bottom: var(--ots-border);
    margin-bottom: var(--ots-space-3);
}
.ots-dashboard__user {
    display: flex;
    align-items: center;
    gap: var(--ots-space-3);
}
.ots-dashboard__user-info h4 {
    font-size: var(--ots-text-sm);
    font-weight: 600;
    color: var(--ots-gray-900);
    margin: 0;
}
.ots-dashboard__user-info span {
    font-size: var(--ots-text-xs);
    color: var(--ots-gray-500);
}

.ots-dashboard__nav {
    list-style: none;
    padding: 0 var(--ots-space-3);
    margin: 0;
}
.ots-dashboard__nav-item {
    margin-bottom: 2px;
}
.ots-dashboard__nav-link {
    display: flex;
    align-items: center;
    gap: var(--ots-space-3);
    padding: var(--ots-space-3) var(--ots-space-4);
    font-size: var(--ots-text-sm);
    font-weight: 500;
    color: var(--ots-gray-600);
    text-decoration: none;
    border-radius: var(--ots-radius);
    transition: all var(--ots-transition);
}
.ots-dashboard__nav-link:hover {
    background: var(--ots-gray-50);
    color: var(--ots-gray-800);
}
.ots-dashboard__nav-link.active {
    background: var(--ots-primary-50);
    color: var(--ots-primary);
    font-weight: 600;
}
.ots-dashboard__nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.ots-dashboard__content {
    flex: 1;
    padding: var(--ots-space-8);
    max-width: 1200px;
}
.ots-dashboard__content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--ots-space-6);
}
.ots-dashboard__content-header h1 {
    font-size: var(--ots-text-2xl);
    font-weight: 800;
    color: var(--ots-gray-900);
    margin: 0;
}


/* ═══════ COURSE SINGLE LAYOUT ═══════ */
.ots-course-hero {
    background: linear-gradient(135deg, var(--ots-primary-dark) 0%, var(--ots-primary) 100%);
    color: var(--ots-white);
    padding: var(--ots-space-12) 0;
}
.ots-course-hero__inner {
    max-width: var(--ots-container-xl);
    margin: 0 auto;
    padding: 0 var(--ots-space-6);
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--ots-space-10);
    align-items: center;
}
.ots-course-hero__breadcrumb {
    font-size: var(--ots-text-sm);
    opacity: 0.8;
    margin-bottom: var(--ots-space-4);
}
.ots-course-hero__breadcrumb a {
    color: var(--ots-white);
    text-decoration: none;
}
.ots-course-hero__breadcrumb a:hover {
    text-decoration: underline;
}
.ots-course-hero__title {
    font-size: var(--ots-text-3xl);
    font-weight: 800;
    margin-bottom: var(--ots-space-4);
    line-height: 1.2;
}
.ots-course-hero__excerpt {
    font-size: var(--ots-text-base);
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: var(--ots-space-6);
}
.ots-course-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ots-space-6);
    font-size: var(--ots-text-sm);
}
.ots-course-hero__meta-item {
    display: flex;
    align-items: center;
    gap: var(--ots-space-2);
    opacity: 0.9;
}

/* Course sidebar panel (enrollment card) */
.ots-course-sidebar-card {
    background: var(--ots-white);
    border-radius: var(--ots-radius-xl);
    padding: var(--ots-space-6);
    box-shadow: var(--ots-shadow-lg);
    color: var(--ots-gray-800);
}
.ots-course-sidebar-card__thumb {
    border-radius: var(--ots-radius-lg);
    overflow: hidden;
    margin-bottom: var(--ots-space-5);
    aspect-ratio: 16/9;
}
.ots-course-sidebar-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ots-course-sidebar-card__price {
    font-size: var(--ots-text-2xl);
    font-weight: 800;
    color: var(--ots-primary);
    margin-bottom: var(--ots-space-4);
}
.ots-course-sidebar-card .ots-btn {
    width: 100%;
    margin-bottom: var(--ots-space-4);
}
.ots-course-sidebar-card__includes {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ots-course-sidebar-card__includes li {
    display: flex;
    align-items: center;
    gap: var(--ots-space-3);
    padding: var(--ots-space-3) 0;
    border-bottom: var(--ots-border);
    font-size: var(--ots-text-sm);
    color: var(--ots-gray-600);
}
.ots-course-sidebar-card__includes li:last-child {
    border-bottom: 0;
}

/* Course body layout */
.ots-course-body {
    max-width: var(--ots-container-xl);
    margin: 0 auto;
    padding: var(--ots-space-10) var(--ots-space-6);
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--ots-space-10);
}
.ots-course-body__main {
    min-width: 0;
}
.ots-course-body__sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

/* Course curriculum */
.ots-curriculum {}
.ots-curriculum__topic {
    border: var(--ots-border);
    border-radius: var(--ots-radius-lg);
    margin-bottom: var(--ots-space-3);
    overflow: hidden;
}
.ots-curriculum__topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ots-space-4) var(--ots-space-5);
    background: var(--ots-gray-50);
    cursor: pointer;
    user-select: none;
    transition: background var(--ots-transition);
}
.ots-curriculum__topic-header:hover {
    background: var(--ots-gray-100);
}
.ots-curriculum__topic-title {
    font-weight: 600;
    font-size: var(--ots-text-base);
    color: var(--ots-gray-800);
}
.ots-curriculum__topic-meta {
    font-size: var(--ots-text-xs);
    color: var(--ots-gray-500);
}
.ots-curriculum__topic-body {
    display: none;
}
.ots-curriculum__topic.is-open .ots-curriculum__topic-body {
    display: block;
}
.ots-curriculum__item {
    display: flex;
    align-items: center;
    gap: var(--ots-space-3);
    padding: var(--ots-space-3) var(--ots-space-5);
    border-top: var(--ots-border);
    font-size: var(--ots-text-sm);
    color: var(--ots-gray-700);
    text-decoration: none;
    transition: background var(--ots-transition);
}
.ots-curriculum__item:hover {
    background: var(--ots-gray-50);
}
.ots-curriculum__item--completed svg {
    color: var(--ots-success);
}
.ots-curriculum__item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--ots-gray-400);
}
.ots-curriculum__item-title {
    flex: 1;
}
.ots-curriculum__item-duration {
    font-size: var(--ots-text-xs);
    color: var(--ots-gray-500);
}
.ots-curriculum__item-badge {
    font-size: var(--ots-text-xs);
    padding: 0.125rem 0.5rem;
    border-radius: var(--ots-radius-full);
    background: var(--ots-info-light);
    color: var(--ots-info);
}


/* ═══════ FOCUS MODE (LESSON) ═══════ */
.ots-focus-mode {
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.ots-focus-mode__sidebar {
    width: 320px;
    background: var(--ots-white);
    border-right: var(--ots-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.ots-focus-mode__sidebar-header {
    padding: var(--ots-space-4) var(--ots-space-5);
    border-bottom: var(--ots-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ots-focus-mode__sidebar-header a {
    font-size: var(--ots-text-sm);
    color: var(--ots-gray-600);
    text-decoration: none;
}
.ots-focus-mode__sidebar-body {
    flex: 1;
    overflow-y: auto;
}
.ots-focus-mode__sidebar-footer {
    padding: var(--ots-space-4);
    border-top: var(--ots-border);
}

.ots-focus-mode__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.ots-focus-mode__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--ots-space-3) var(--ots-space-6);
    border-bottom: var(--ots-border);
    background: var(--ots-white);
    position: sticky;
    top: 0;
    z-index: 10;
}
.ots-focus-mode__toolbar-nav {
    display: flex;
    gap: var(--ots-space-2);
}
.ots-focus-mode__body {
    flex: 1;
    padding: var(--ots-space-8) var(--ots-space-10);
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}
.ots-focus-mode__body h1 {
    font-size: var(--ots-text-2xl);
    margin-bottom: var(--ots-space-6);
}
.ots-focus-mode__video {
    margin-bottom: var(--ots-space-8);
    border-radius: var(--ots-radius-xl);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--ots-gray-900);
}
.ots-focus-mode__video iframe,
.ots-focus-mode__video video {
    width: 100%;
    height: 100%;
    display: block;
}


/* ═══════ COURSE ARCHIVE LAYOUT ═══════ */
.ots-archive-header {
    background: linear-gradient(135deg, var(--ots-primary-dark) 0%, var(--ots-primary) 100%);
    color: var(--ots-white);
    padding: var(--ots-space-12) 0;
    text-align: center;
}
.ots-archive-header h1 {
    font-size: var(--ots-text-3xl);
    font-weight: 800;
    margin-bottom: var(--ots-space-3);
}
.ots-archive-header p {
    font-size: var(--ots-text-base);
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}
.ots-archive-toolbar {
    max-width: var(--ots-container-xl);
    margin: 0 auto;
    padding: var(--ots-space-6);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ots-space-4);
}
.ots-archive-toolbar__filters {
    display: flex;
    gap: var(--ots-space-3);
    flex-wrap: wrap;
}
.ots-archive-toolbar__count {
    font-size: var(--ots-text-sm);
    color: var(--ots-gray-500);
}
.ots-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--ots-space-6);
    max-width: var(--ots-container-xl);
    margin: 0 auto;
    padding: 0 var(--ots-space-6) var(--ots-space-10);
}


/* ═══════ AUTH LAYOUT ═══════ */
.ots-auth {
    min-height: 100vh;
    display: flex;
}
.ots-auth__panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ots-space-8);
}
.ots-auth__form-wrap {
    width: 100%;
    max-width: 420px;
}
.ots-auth__logo {
    margin-bottom: var(--ots-space-8);
}
.ots-auth__title {
    font-size: var(--ots-text-2xl);
    font-weight: 800;
    margin-bottom: var(--ots-space-2);
}
.ots-auth__subtitle {
    font-size: var(--ots-text-sm);
    color: var(--ots-gray-500);
    margin-bottom: var(--ots-space-8);
}
.ots-auth__feature {
    flex: 1;
    background: linear-gradient(135deg, var(--ots-primary-dark) 0%, var(--ots-primary) 50%, var(--ots-accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ots-white);
    padding: var(--ots-space-10);
}
.ots-auth__feature-content {
    max-width: 500px;
    text-align: center;
}
.ots-auth__feature-content h2 {
    font-size: var(--ots-text-3xl);
    font-weight: 800;
    margin-bottom: var(--ots-space-4);
}
.ots-auth__feature-content p {
    font-size: var(--ots-text-lg);
    opacity: 0.85;
}


/* ═══════ SEARCH OVERLAY ═══════ */
.ots-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: var(--ots-z-modal);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
}
.ots-search-overlay.is-open { display: flex; }
.ots-search-overlay__box {
    background: var(--ots-white);
    border-radius: var(--ots-radius-xl);
    width: 100%;
    max-width: 640px;
    box-shadow: var(--ots-shadow-xl);
    overflow: hidden;
}
.ots-search-overlay__input-wrap {
    display: flex;
    align-items: center;
    padding: var(--ots-space-4) var(--ots-space-5);
    border-bottom: var(--ots-border);
}
.ots-search-overlay__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: var(--ots-text-lg);
    padding: var(--ots-space-2);
}
.ots-search-overlay__results {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--ots-space-2);
}


/* ═══════ STAT CARDS GRID ═══════ */
.ots-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--ots-space-4);
    margin-bottom: var(--ots-space-8);
}


/* ═══════ GENERAL SECTIONS ═══════ */
.ots-section {
    padding: var(--ots-space-16) 0;
}
.ots-section--gray {
    background: var(--ots-gray-50);
}
.ots-section__header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--ots-space-10);
}
.ots-section__header h2 {
    font-size: var(--ots-text-2xl);
    font-weight: 800;
    margin-bottom: var(--ots-space-3);
}
.ots-section__header p {
    font-size: var(--ots-text-base);
    color: var(--ots-gray-500);
}
