:root {
    --navy: #0A2647;
    --navy-2: #123B6D;
    --navy-light: #144272;
    --accent: #2C74B3;
    --accent-hover: #205a8f;
    --gold: #F5A623;
    --bg: #F4F6FA;
    --white: #FFFFFF;
    --text: #1B1B1F;
    --muted: #6B7280;
    --border: #E2E6EC;
    --locked-bg: #E9ECF1;
    --radius: 14px;
    --shadow-sm: 0 1px 3px rgba(10,38,71,0.07);
    --shadow-md: 0 8px 24px rgba(10,38,71,0.12);
}

* { box-sizing: border-box; }

/* The hidden attribute must always win over any display rule below it,
   otherwise elements with their own "display:flex" would stay visible
   even while marked hidden. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--navy);
    color: var(--white);
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 0 rgba(255,255,255,0.08);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.brand-logo {
    background: var(--white);
    border-radius: 9px;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.brand-logo img { height: 26px; width: auto; display: block; }

.brand-name {
    color: var(--white);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.2px;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.25);
}

/* On phones, the logo alone carries the brand — drop the extra label. */
@media (max-width: 560px) {
    .brand-name { display: none; }
    .brand-logo img { height: 22px; }
}

.modal-logo { width: 52px; height: 52px; display: block; margin: 0 auto; }

.auth-area { display: flex; align-items: center; }
.student-name { font-size: 14px; margin-right: 10px; opacity: 0.9; }

/* ---------- Buttons ---------- */
.btn {
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 9px;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }

.btn-outline {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.45);
    color: var(--white);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); }

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #3D8AD1);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(44,116,179,0.35);
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-full { width: 100%; }
.btn-small { padding: 8px 14px; font-size: 13px; }

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px;
}
.link-btn:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(ellipse 80% 120% at 70% -20%, rgba(44,116,179,0.55), transparent),
        linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%);
    color: var(--white);
    padding: 44px 16px 92px;
    text-align: center;
}

.hero-inner { max-width: 720px; margin: 0 auto; }

.hero h1 {
    font-size: 28px;
    line-height: 1.25;
    margin: 0 0 10px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.hero p {
    margin: 0 auto;
    max-width: 520px;
    color: rgba(255,255,255,0.75);
    font-size: 14.5px;
    line-height: 1.55;
}

.hero-stats {
    margin-top: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 999px;
    padding: 12px 20px;
    backdrop-filter: blur(4px);
}
@media (min-width: 640px) {
    .hero-stats { gap: 22px; padding: 12px 28px; }
}

.stat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.stat-num { font-size: 18px; font-weight: 800; color: var(--gold); }
.stat-label { font-size: 11px; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.6px; }
.stat-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.18); }

/* ---------- Filter panel (overlaps hero) ---------- */
.filter-panel {
    max-width: 1100px;
    margin: -52px auto 0;
    padding: 18px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 5;
}

@media (max-width: 1130px) {
    .filter-panel { margin-left: 16px; margin-right: 16px; }
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.input-wrap { position: relative; }
.input-wrap svg {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--muted);
    pointer-events: none;
}
.input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-size: 14px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.input-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
}

/* Job-type tabs */
.type-tabs {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    background: var(--bg);
    padding: 5px;
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}
.type-tabs::-webkit-scrollbar { display: none; }
.type-tab {
    flex: 1;
    min-width: max-content;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-radius: 9px;
    padding: 9px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.type-tab:hover { color: var(--navy); }
.type-tab-active {
    background: var(--white);
    color: var(--navy);
    box-shadow: var(--shadow-sm);
}
.type-count {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.7;
    margin-left: 2px;
}

/* Category chips */
.chip-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-light);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-active, .chip-active:hover {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
}

.filter-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    min-height: 20px;
}
#resultsCount { font-size: 13px; color: var(--muted); }

/* ---------- Unlock banner ---------- */
.unlock-banner {
    max-width: 1100px;
    margin: 18px auto 0;
    padding: 14px 18px;
    background: linear-gradient(120deg, var(--navy-light), var(--navy-2));
    color: var(--white);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}
@media (max-width: 1130px) {
    .unlock-banner { margin-left: 16px; margin-right: 16px; }
}
.unlock-banner span:nth-child(2) { flex: 1; font-weight: 500; }
.lock-emoji { font-size: 18px; }

/* ---------- Job grid ---------- */
.jobs-grid {
    max-width: 1100px;
    margin: 20px auto 40px;
    padding: 0 16px;
    display: grid;
    /* minmax(0, 1fr) lets tracks shrink below their content's min-content
       width — without the 0, a long unbreakable word in a card forces the
       column wider than 1fr and the whole grid overflows. */
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.job-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.job-card:not(.locked):hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.job-card-top { display: flex; align-items: flex-start; gap: 12px; }

.company-avatar {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 800;
    color: var(--white);
}

.job-headings { flex: 1; min-width: 0; }
.job-title, .job-company, .job-snippet { overflow-wrap: anywhere; }
.job-title-link { text-decoration: none; display: block; }
.job-title-link:hover { color: var(--accent); text-decoration: underline; }

.job-title {
    font-size: 15.5px;
    font-weight: 700;
    margin: 0 0 2px;
    color: var(--navy);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.job-company {
    font-size: 13.5px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.job-meta .badge { align-self: center; }
.meta-chip {
    font-size: 12px;
    color: var(--navy-light);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.meta-salary { color: #1B7A43; background: #EAF7EF; border-color: #CBEBD7; font-weight: 600; }
.meta-date { color: var(--muted); }

.job-snippet {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.badge {
    display: inline-block;
    background: var(--locked-bg);
    color: var(--navy-light);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.badge-internship { background: #FFF1E0; color: #B45309; }
.badge-seo { background: #E5F3E8; color: #166534; }
.badge-performance-marketing { background: #E8EEFB; color: #1D4ED8; }
.badge-digital-marketing { background: #EDE9FE; color: #6D28D9; }
.badge-social-media-marketing { background: #FCE7F3; color: #BE185D; }
.badge-google-ads { background: #FEF3C7; color: #92400E; }
.badge-meta-ads { background: #E0F2FE; color: #0369A1; }

.job-card-footer {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border);
}
.job-source { font-size: 12px; color: var(--muted); text-transform: capitalize; }

/* ---------- Locked card ---------- */
.job-card.locked { position: relative; overflow: hidden; }
.job-card.locked .locked-content {
    filter: blur(5px);
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}
.locked-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(244,246,250,0.3), rgba(244,246,250,0.75));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    padding: 12px;
}
.locked-overlay .lock-emoji { font-size: 24px; }
.locked-overlay-text { font-size: 13px; font-weight: 800; color: var(--navy); letter-spacing: 0.2px; }

/* ---------- Skeleton loading ---------- */
.skeleton-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 18px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sk {
    background: linear-gradient(90deg, #EEF1F6 25%, #F7F9FC 50%, #EEF1F6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite;
    border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-title { height: 16px; width: 70%; }
.sk-sub { height: 12px; width: 45%; }
.sk-line { height: 11px; width: 100%; }
.sk-line-short { height: 11px; width: 60%; }
.sk-btn { height: 32px; width: 110px; border-radius: 9px; align-self: flex-end; }

/* ---------- States ---------- */
.empty-state {
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    padding: 40px 16px;
}

.site-footer {
    text-align: center;
    color: var(--muted);
    font-size: 12.5px;
    padding: 24px 16px 34px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10,38,71,0.6);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}
.modal {
    background: var(--white);
    border-radius: 18px;
    padding: 28px 24px;
    width: 100%;
    max-width: 390px;
    position: relative;
    box-shadow: 0 24px 60px rgba(10,38,71,0.35);
}
.modal-head { text-align: center; margin-bottom: 18px; }
.modal-head .brand-mark { font-size: 15px; }
.modal h2 { margin: 12px 0 4px; font-size: 19px; color: var(--navy); }
.modal-sub { margin: 0; font-size: 13px; color: var(--muted); }
.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--bg);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}
.modal-close:hover { background: var(--locked-bg); }
#loginForm label { display: block; font-size: 13px; font-weight: 600; margin: 13px 0 6px; color: var(--navy); }
#loginForm input {
    width: 100%;
    padding: 11px 13px;
    border-radius: 9px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-size: 14px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
#loginForm input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--white);
}
.form-error { color: #B3261E; font-size: 13px; margin: 10px 0 0; }
#loginSubmitBtn { margin-top: 20px; }

/* ---------- Hot badge + days filter (SPA) ---------- */
.hot-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FF6B35, #F7931E);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(247,107,53,0.35);
}
.days-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.days-filter-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.day-chip {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--navy-light);
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 999px;
    padding: 6px 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.day-chip:hover { border-color: var(--accent); color: var(--accent); }
.day-chip-active, .day-chip-active:hover {
    background: #FF6B35; border-color: #FF6B35; color: #fff;
}
.remote-toggle {
    font-size: 12.5px;
    font-weight: 700;
    color: #0E7490;
    background: #ECFEFF;
    border: 1.5px solid #A5F0FC;
    border-radius: 999px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: auto;
}
.remote-toggle:hover { border-color: #0891B2; }
.remote-toggle-active, .remote-toggle-active:hover {
    background: #0891B2; border-color: #0891B2; color: #fff;
}
.meta-remote { color: #0E7490; background: #ECFEFF; border-color: #A5F0FC; font-weight: 600; }
@media (max-width: 560px) { .remote-toggle { margin-left: 0; } }

/* ---------- Server-rendered detail page ---------- */
.detail-wrap { max-width: 780px; margin: 24px auto 40px; padding: 0 16px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.detail-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 26px 24px;
}
.detail-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.detail-avatar { width: 56px; height: 56px; font-size: 22px; border-radius: 12px; }
.detail-headings h1 { font-size: 22px; color: var(--navy); margin: 0 0 4px; line-height: 1.25; }
.detail-company { font-size: 15px; color: var(--muted); font-weight: 600; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.detail-body h2, .detail-locked h2 { font-size: 16px; color: var(--navy); margin: 0 0 8px; }
.detail-body p { font-size: 14.5px; line-height: 1.65; color: var(--text); margin: 0 0 12px; }
.detail-source { font-size: 12.5px; color: var(--muted); }
.detail-actions { margin-top: 20px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.detail-locked {
    text-align: center;
    padding: 26px 16px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}
.detail-locked .lock-emoji { font-size: 30px; }
.detail-locked p { max-width: 440px; margin: 8px auto 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.detail-back { margin-top: 20px; }
.detail-back a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }
.detail-back a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

/* ---------- Server-rendered browse / landing page ---------- */
.browse-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
.browse-hero {
    text-align: center;
    padding: 40px 16px 30px;
}
.browse-hero h1 { font-size: 26px; color: var(--navy); margin: 0 0 8px; }
.browse-hero p { color: var(--muted); font-size: 14.5px; margin: 0 0 18px; }
.browse-grid { margin-top: 4px; }
.job-card-link { text-decoration: none; color: inherit; }
.job-card-link .job-title { color: var(--navy); }
.browse-links { margin-top: 36px; text-align: center; }
.browse-links h2 { font-size: 16px; color: var(--navy); margin-bottom: 14px; }
.browse-links .chip-row { justify-content: center; flex-wrap: wrap; overflow: visible; }
.browse-links .chip { text-decoration: none; }

/* ---------- Tablet / Desktop ---------- */
@media (min-width: 640px) {
    .hero h1 { font-size: 34px; }
    .filter-row { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
@media (min-width: 720px) {
    .jobs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .jobs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
