/* =========================================================
   GK Help Site — Shared Stylesheet
   ========================================================= */

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

:root {
    --purple:      #673DE6;
    --purple-dark: #4f2db8;
    --purple-soft: #EDE8FC;
    --bg:          #F4F5FF;
    --surface:     #FFFFFF;
    --text:        #1E1B2E;
    --muted:       #6B6882;
    --border:      #E2E1EF;
    --red:         #E53E3E;
    --shadow-sm:   0 1px 3px rgba(103,61,230,0.08);
    --shadow-md:   0 4px 16px rgba(103,61,230,0.12);
    --radius:      10px;
    --radius-sm:   6px;
}

body {
    margin: 0;
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Top nav bar ── */
.topnav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.topnav-logo img { height: 38px; display: block; }
.topnav-links { display: flex; align-items: center; gap: 8px; }
.topnav-links a {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}
.topnav-links a:hover { background: var(--purple-soft); color: var(--purple); }
.topnav-links a.active { background: var(--purple-soft); color: var(--purple); }
.topnav-links .logout-btn {
    color: var(--red);
    border: 1px solid #fdd;
}
.topnav-links .logout-btn:hover { background: #fff0f0; color: var(--red); }

/* ── Breadcrumb ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    padding: 18px 40px 0;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}
.breadcrumb a { color: var(--purple); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

/* ── Page header ── */
.page-header {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 28px 40px 8px;
}
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}
.page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
}

/* ── Section label ── */
.section-label {
    max-width: 960px;
    margin: 32px auto 12px;
    width: 100%;
    padding: 0 40px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--muted);
    text-transform: uppercase;
}

/* ── Link cards ── */
.card-list {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 0 40px 48px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.card-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.card-link:hover {
    border-color: var(--purple);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    color: var(--purple);
}
.card-link-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--purple-soft);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin-right: 14px;
}
.card-link-icon svg { width: 18px; height: 18px; }
.card-link-left { display: flex; align-items: center; }
.card-link-meta { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.card-link-text { display: flex; flex-direction: column; }
.card-link-arrow { color: var(--purple); opacity: 0.5; flex-shrink: 0; }

/* ── Department grid (Main page) ── */
.dept-grid {
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    padding: 0 40px 48px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.dept-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px 24px;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dept-card:hover {
    border-color: var(--purple);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.dept-card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: var(--purple-soft);
    display: flex; align-items: center; justify-content: center;
}
.dept-card-icon svg { width: 22px; height: 22px; min-width: 22px; min-height: 22px; flex-shrink: 0; }
.dept-card h2 { margin: 0; font-size: 15px; font-weight: 700; }
.dept-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── Video page ── */
.video-container {
    max-width: 900px;
    margin: 24px auto;
    width: calc(100% - 80px);
}
.video-wrapper {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: #000;
}
.video-wrapper iframe {
    width: 100%; height: 100%;
    border: none; display: block;
}
.video-title {
    margin: 16px 0 4px;
    font-size: 18px;
    font-weight: 700;
}
.video-desc {
    color: var(--muted);
    font-size: 14px;
    margin: 0 0 32px;
}

/* ── Login page ── */
.login-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    padding: 48px 44px;
    width: 100%;
    max-width: 400px;
}
.login-card img { display: block; margin: 0 auto 32px; height: 42px; }
.login-card h1 { text-align: center; font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.login-card .subtitle { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color 0.15s;
    color: var(--text);
}
.login-card input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(103,61,230,0.1); }
.login-card .login-btn {
    width: 100%;
    background: var(--purple);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.login-card .login-btn:hover { background: var(--purple-dark); }
.login-error {
    background: #fff0f0;
    border: 1px solid #fcc;
    color: var(--red);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* ── Footer ── */
.site-footer {
    margin-top: auto;
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: var(--border);
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .topnav { padding: 0 16px; }
    .topnav-links a span { display: none; }
    .dept-grid { grid-template-columns: 1fr 1fr; padding: 0 16px 40px; }
    .card-list, .section-label, .page-header, .breadcrumb { padding-left: 16px; padding-right: 16px; }
    .video-container { width: calc(100% - 32px); }
    .login-card { padding: 36px 24px; }
}
@media (max-width: 480px) {
    .dept-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   v2 — Topic grid & Dashboard button cards
   ========================================================= */


/* Download cards — same as card-link but with download icon */
.download-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: #EEF9F0;
    color: #2D7A3A;
    flex-shrink: 0;
}
.download-badge.pdf  { background: #FFF0F0; color: #C53030; }
.download-badge.xlsx { background: #EEF9F0; color: #2D7A3A; }
.download-badge.docx { background: #EBF4FF; color: #1A56DB; }
.download-badge.file { background: #F5F0FF; color: #5B21B6; }

@media (max-width: 700px) {
    .topic-grid    { grid-template-columns: 1fr; padding: 0 16px 40px; }
    .dashboard-grid{ grid-template-columns: 1fr; padding: 0 16px 40px; }
}

/* Icon-only dept cards */
.dept-card--icon-only {
    align-items: center;
    justify-content: center;
    padding: 32px 16px 24px;
    gap: 14px;
}
.dept-card--icon-only svg {
    flex-shrink: 0;
}
.dept-card--icon-only h2 {
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    margin: 0;
    color: var(--text);
}

/* Mobile YouTube hint — only shows on small screens */
.yt-mobile-hint {
    display: none;
    margin-top: 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    align-items: center;
    gap: 12px;
}
.yt-mobile-hint svg { flex-shrink: 0; }
.yt-mobile-hint-text { flex: 1; font-size: 13px; color: var(--muted); line-height: 1.4; }
.yt-mobile-hint-text strong { color: var(--text); display: block; margin-bottom: 2px; }
.yt-mobile-hint a {
    font-size: 13px;
    font-weight: 700;
    color: var(--purple);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.yt-mobile-hint a:hover { text-decoration: underline; }

@media (max-width: 768px) {
    .yt-mobile-hint { display: flex; }
}

/* Self-hosted HTML5 video player */
.video-wrapper.video-wrapper--native {
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.video-wrapper.video-wrapper--native video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block;
    background: #000;
}
