/* RemoteHub - Clean professional job board */

:root {
    --bg: #fafaf7;
    --surface: #ffffff;
    --ink: #18181b;
    --ink-soft: #52525b;
    --ink-faint: #a1a1aa;
    --line: #e4e4e7;
    --accent: #18181b;
    --accent-hover: #3f3f46;
    --green: #15803d;
    --green-soft: #dcfce7;
    --orange: #c2410c;
    --orange-soft: #ffedd5;
    --blue: #1e40af;
    --blue-soft: #dbeafe;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.92);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 20px;
}

.logo-mark {
    color: var(--green);
    font-size: 22px;
}

.main-nav {
    display: flex;
    gap: 24px;
}

.main-nav a {
    color: var(--ink-soft);
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--ink);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #ffffff 0%, #f4f4f1 100%);
    border-bottom: 1px solid var(--line);
    padding: 64px 0 48px;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 44px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 14px;
    max-width: 720px;
}

.hero-sub {
    font-size: 17px;
    color: var(--ink-soft);
    margin-bottom: 32px;
    max-width: 600px;
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cat-pill {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cat-pill:hover {
    border-color: var(--ink);
    color: var(--ink);
}

.cat-pill.active {
    background: var(--ink);
    color: white;
    border-color: var(--ink);
}

.cat-pill .count {
    background: rgba(0,0,0,0.06);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 12px;
}

.cat-pill.active .count {
    background: rgba(255,255,255,0.18);
}

/* Jobs list */
.jobs-list {
    margin: 32px 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
}

.job-card {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
    transition: background 0.15s;
    align-items: center;
}

.job-card:last-child { border-bottom: none; }

.job-card:hover {
    background: #fafafa;
}

.job-logo img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: contain;
    background: white;
    border: 1px solid var(--line);
    padding: 4px;
}

.logo-fallback {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: linear-gradient(135deg, #18181b, #52525b);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 22px;
}

.logo-fallback.large {
    width: 80px;
    height: 80px;
    font-size: 32px;
    border-radius: 14px;
}

.job-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 4px;
    line-height: 1.3;
}

.job-meta {
    font-size: 14px;
    color: var(--ink-soft);
    margin-bottom: 8px;
}

.company { font-weight: 500; color: var(--ink); }
.dot { margin: 0 4px; opacity: 0.5; }

.job-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag {
    font-size: 12px;
    padding: 3px 9px;
    border-radius: 6px;
    background: #f4f4f5;
    color: var(--ink-soft);
    font-weight: 500;
    text-transform: capitalize;
}

.tag-cat {
    background: var(--blue-soft);
    color: var(--blue);
}

.tag-salary {
    background: var(--green-soft);
    color: var(--green);
}

.job-date {
    font-size: 13px;
    color: var(--ink-faint);
    white-space: nowrap;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 32px 0;
    font-size: 15px;
}

.pagination a {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.15s;
}

.pagination a:hover {
    border-color: var(--ink);
}

.page-info {
    color: var(--ink-soft);
}

/* Job detail page */
.breadcrumb {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
    font-size: 14px;
    color: var(--ink-faint);
}

.breadcrumb a {
    color: var(--ink-soft);
    transition: color 0.15s;
}

.breadcrumb a:hover { color: var(--ink); }

.breadcrumb span { color: var(--ink); }

.job-detail {
    padding: 40px 20px;
}

.job-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    margin-bottom: 32px;
    align-items: start;
}

.job-header h1 {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    line-height: 1.2;
}

.company-line {
    font-size: 17px;
    color: var(--ink-soft);
    margin-bottom: 14px;
}

.post-date {
    color: var(--ink-faint);
    font-size: 14px;
    margin-top: 14px;
}

.apply-btn {
    display: inline-block;
    background: var(--ink);
    color: white;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    margin: 24px 0 32px;
    transition: all 0.2s;
    border: 1px solid var(--ink);
}

.apply-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.job-description {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
    font-size: 16px;
    line-height: 1.7;
    color: #27272a;
}

.job-description h1, .job-description h2, .job-description h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    font-weight: 700;
}

.job-description h1 { font-size: 22px; }
.job-description h2 { font-size: 19px; }
.job-description h3 { font-size: 17px; }

.job-description p { margin-bottom: 14px; }

.job-description ul, .job-description ol {
    margin: 14px 0;
    padding-left: 24px;
}

.job-description li { margin-bottom: 6px; }

.job-description a {
    color: var(--blue);
    text-decoration: underline;
}

.apply-cta {
    background: linear-gradient(135deg, #f4f4f1, #fafaf7);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
    margin-top: 32px;
    text-align: center;
}

.apply-cta h3 {
    font-size: 22px;
    margin-bottom: 8px;
    font-weight: 700;
}

.apply-cta p {
    color: var(--ink-soft);
    margin-bottom: 16px;
}

.job-skills {
    margin-top: 32px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.job-skills h3 {
    font-size: 17px;
    margin-bottom: 12px;
    font-weight: 700;
}

/* Resources / Backlinks section */
.resources-section {
    margin-top: 56px;
    padding-top: 40px;
    border-top: 1px solid var(--line);
}

.resources-section h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.resources-sub {
    color: var(--ink-soft);
    margin-bottom: 24px;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.resource-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.15s;
    display: block;
}

.resource-card:hover {
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

.resource-cat {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--orange);
    background: var(--orange-soft);
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.resource-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink);
}

.resource-card p {
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
}

/* Footer */
.site-footer {
    margin-top: 80px;
    padding: 32px 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--ink-faint);
    font-size: 14px;
}

.site-footer a {
    color: var(--ink-soft);
    text-decoration: underline;
}

.empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--ink-faint);
}

/* ===================
   ADMIN STYLES
   =================== */

.admin-body {
    background: #f4f4f5;
    min-height: 100vh;
}

.admin-header {
    background: var(--ink);
    color: white;
    padding: 16px 0;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header a { color: white; }

.admin-nav {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.admin-nav a:hover { opacity: 0.8; }

.admin-main {
    padding: 32px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.admin-main h1 {
    font-size: 28px;
    margin-bottom: 24px;
}

.admin-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
}

.admin-card h2 {
    font-size: 18px;
    margin-bottom: 16px;
}

.form-row {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.form-row label {
    font-weight: 500;
    font-size: 14px;
    color: var(--ink-soft);
}

.form-row input, .form-row textarea, .form-row select {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    width: 100%;
}

.form-row input:focus, .form-row textarea:focus {
    outline: none;
    border-color: var(--ink);
}

.btn {
    background: var(--ink);
    color: white;
    border: none;
    padding: 11px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: inline-block;
}

.btn:hover { background: var(--accent-hover); }

.btn-secondary {
    background: white;
    color: var(--ink);
    border: 1px solid var(--line);
}

.btn-secondary:hover { border-color: var(--ink); }

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover { background: #b91c1c; }

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

table.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.admin-table th {
    background: #fafafa;
    font-weight: 600;
    color: var(--ink-soft);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table td a { color: var(--blue); text-decoration: underline; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 18px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--ink-soft);
    margin-top: 6px;
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    max-width: 380px;
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 36px;
    border: 1px solid var(--line);
}

.login-box h1 {
    font-size: 22px;
    margin-bottom: 6px;
}

.login-box p.sub {
    color: var(--ink-soft);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Mobile */
@media (max-width: 640px) {
    .hero { padding: 40px 0 32px; }
    .job-card {
        grid-template-columns: 48px 1fr;
        gap: 12px;
        padding: 16px;
    }
    .job-date { 
        grid-column: 1 / -1;
        font-size: 12px;
    }
    .job-logo img, .logo-fallback {
        width: 48px;
        height: 48px;
    }
    .job-header { grid-template-columns: 1fr; }
    .job-description { padding: 20px; }
    .resources-grid { grid-template-columns: 1fr; }
    .main-nav { display: none; }
}
