:root {
    --light-bg: #f9fafb;
    --light-card-bg: #ffffff;
    --light-border: #e5e7eb;
    --light-text-main: #111827;
    --light-text-sub: #6b7280;
    --light-accent: #2563eb; /* Royal Blue */
    --light-accent-hover: #1d4ed8;
    --light-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --page-bg: #f5f6f8;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --text-main: #0f172a;
    --text-sub: #6b7280;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
}

.supabase-jobs-container {
    font-family: var(--light-font);
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    border-radius: 8px;
    color: var(--light-text-main);
}

/* Hero */
.jobs-hero {
    text-align: center;
    margin: 22px 0 26px 0;
}
.jobs-hero h1 {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 12px 0;
    line-height: 1.15;
    color: #111827;
}
.jobs-hero p {
    color: #374151;
    margin: 0 0 18px 0;
    font-size: 18px;
    line-height: 1.4;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

/* Category Pills */
.jobs-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0 auto 22px;
    max-width: 900px;
}
.jobs-category-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 10px;
    background: #e8f0ff;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.jobs-category-pill:hover {
    background: #dbeafe;
    border-color: #bfdbfe;
}
.jobs-category-pill.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.2);
}

/* Search Form */
.jobs-search-form {
    display: flex;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    margin: 0 auto 30px;
    max-width: 900px;
}
.jobs-search-input {
    width: 100%;
    padding: 14px 16px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    color: var(--light-text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.jobs-search-input:focus {
    border-color: var(--light-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.jobs-search-button {
    padding: 14px 22px;
    background-color: var(--light-accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.jobs-search-button:hover {
    background-color: var(--light-accent-hover);
}

/* Toolbar */
.jobs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px auto 22px;
    max-width: 900px;
    color: var(--light-text-sub);
    font-size: 14px;
}
.jobs-count { font-weight: 600; color: var(--light-text-main); }
.sort-select {
    padding: 10px 12px;
    border: 1px solid var(--light-border);
    border-radius: 6px;
    background: #fff;
    color: var(--light-text-main);
}

/* Grid Layout */
.supabase-jobs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Card Design */
.supabase-job-card {
    background-color: #f8f8f8;
    border: 1px solid var(--light-border);
    border-radius: 16px;
    padding: 22px 22px;
    min-height: 150px;
    display: flex;
    align-items: stretch;
    gap: 16px;
    transition: all 0.2s ease;
    position: relative;
}
.job-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--light-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.job-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}
.job-logo-fallback {
    background: #eef2ff;
    color: #1e3a8a;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
}
.supabase-job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border-color: #d1d5db;
}

.supabase-job-card.is-featured {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 45%, #ecfeff 100%);
    border-color: #fb923c;
}

.job-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.job-header { margin-bottom: 0; }

.job-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--light-text-main);
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.job-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--light-text-sub);
}

.job-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

.job-meta-text {
    font-weight: 500;
}

.job-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-left: auto;
    min-width: 150px;
}

.job-apply-btn {
    display: inline-block;
    padding: 11px 18px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25);
}
.job-apply-btn:hover {
    background-color: #1d4ed8;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.32);
    color: white;
}

.job-badges { display: flex; gap: 8px; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; }
.badge-new { background: #fde68a; color: #92400e; }
.badge-age { background: #f3f4f6; color: #374151; }
.badge-featured { background: #dbeafe; color: #1e40af; }

/* Pagination */
.jobs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    gap: 16px;
}
.pagination-link {
    padding: 8px 16px;
    background-color: white;
    border: 1px solid var(--light-border);
    border-radius: 6px;
    color: var(--light-text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}
.pagination-link:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}
.pagination-info {
    color: var(--light-text-sub);
    font-size: 14px;
}

/* Empty State */
.no-jobs-found {
    text-align: center;
    padding: 60px;
    font-size: 16px;
    color: var(--light-text-sub);
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--light-border);
}

/* Job Detail Styles */
.jd-page {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1100px;
    margin: 40px auto 60px;
    padding: 0 20px;
    color: var(--text-main);
}
.jd-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}
.jd-breadcrumb a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}
.jd-breadcrumb a:hover { color: #111827; }
.jd-breadcrumb span { color: #9ca3af; }
.jd-breadcrumb .active {
    background: #e0f2fe; /* Light sky blue */
    color: #0284c7; /* Sky blue text */
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
}

.jd-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

/* Main Column */
.jd-main-col {
    min-width: 0;
}

.jd-title {
    font-size: 36px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 24px 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.jd-posted-meta {
    margin: -16px 0 22px 0;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.jd-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
}
.jd-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px; /* Larger padding like image */
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px; /* Smooth rounded corners */
    font-size: 15px;
    color: #374151;
    font-weight: 500;
}
.jd-chip-icon-svg {
    width: 20px;
    height: 20px;
    color: #9ca3af; /* Light gray icon */
    flex-shrink: 0;
}
.jd-chip-icon {
    font-size: 18px;
    color: #9ca3af;
    line-height: 1;
}

.jd-description {
    font-size: 16px;
    line-height: 1.8;
    color: #374151;
    margin-top: 8px;
    white-space: pre-wrap;
}

.jd-description p {
    margin: 0 0 12px 0;
}

.jd-description a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.jd-description a:hover,
.jd-description a:focus {
    color: #1d4ed8;
}

.jd-description .jd-desc-heading {
    margin: 18px 0 10px 0;
    font-size: 18px;
    font-weight: 800;
    color: #111827;
}

.jd-description .jd-desc-list {
    margin: 0 0 14px 18px;
    padding: 0;
}

.jd-description .jd-desc-list li {
    margin: 0 0 8px 0;
}

/* Sidebar */
.jd-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.jd-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jd-apply-btn {
    display: flex; /* Centering */
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 16px;
    background-color: #1d4ed8; /* Royal blue */
    color: white;
    font-weight: 600;
    font-size: 16px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.2s;
    box-shadow: 0 4px 6px -1px rgba(29, 78, 216, 0.1), 0 2px 4px -1px rgba(29, 78, 216, 0.06);
    box-sizing: border-box;
}
.jd-apply-btn:hover {
    background-color: #1e40af;
    color: white;
}

.jd-auto-apply-btn {
    width: 100%;
    padding: 14px;
    background-color: #dbeafe; /* Very light blue */
    color: #1e40af;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: not-allowed;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

/* Company Card */
.jd-company-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px; /* More rounded */
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.jd-company-header {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
}

/* Override previous logo styles if conflicts, or ensure html structure matches */
.jd-company-header .job-logo {
    width: 56px;
    height: 56px;
    border-radius: 50%; /* Circle */
    border: 1px solid #f3f4f6;
    overflow: hidden;
}
.jd-company-header .job-logo-fallback {
    background: #111827; 
    color: white;
    font-size: 18px;
}

.jd-company-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.jd-company-name-side {
    font-weight: 700;
    font-size: 18px;
    color: #111827;
}
.jd-company-loc-side {
    color: #6b7280;
    font-size: 14px;
}

.jd-company-profile-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background-color: #eff6ff; /* Light blue bg */
    color: #2563eb;
    font-weight: 600;
    font-size: 15px;
    border-radius: 10px;
    text-decoration: none;
    margin-bottom: 16px;
    transition: background 0.2s;
}
.jd-company-profile-btn:hover {
    background-color: #dbeafe;
    text-decoration: none;
    color: #1d4ed8;
}

.jd-share-box {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.jd-share-title {
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 12px 0;
}
.jd-share-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.jd-share-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
}
.jd-share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}
.jd-share-btn:hover {
    background: #f3f4f6;
}

.jd-share-status {
    margin-top: 10px;
    font-size: 13px;
    color: #374151;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.jd-share-box[data-share-status="copied"] .jd-share-status,
.jd-share-box[data-share-status="failed"] .jd-share-status {
    opacity: 1;
}
.jd-share-box[data-share-status="failed"] .jd-share-status {
    color: #b91c1c;
}

.jd-company-footer {
    text-align: center;
    font-size: 14px;
    color: #4b5563;
}
.jd-company-footer strong {
    color: #111827;
}

@media (max-width: 900px) {
    .jd-layout { grid-template-columns: 1fr; }
}

/* Company Detail Page */
.company-page {
    font-family: var(--light-font);
    max-width: 1100px;
    margin: 40px auto 60px;
    padding: 0 20px;
    color: var(--text-main);
}
.company-breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 32px;
}
.company-breadcrumb a { text-decoration: none; color: inherit; transition: color 0.2s; }
.company-breadcrumb a:hover { color: #111827; }
.company-breadcrumb span { color: #9ca3af; }
.company-breadcrumb .active { color: #374151; font-weight: 500; }

.company-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px; /* More spacing */
    margin-bottom: 40px;
    background: transparent; /* Ensure no card bg */
    border: none;
    box-shadow: none;
}

.company-hero-left {
    display: flex;
    gap: 20px;
    flex: 1;
}

.company-hero-logo .job-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%; /* Image implies circle */
    border: none;
    background: #111827; 
    overflow: hidden;
}
.company-hero-logo .job-logo img {
    border-radius: 50%;
}
.company-hero-logo .job-logo-fallback {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #111827;
    color: white;
    font-size: 20px;
}

.company-hero-text {
    flex: 1;
}

.company-title {
    font-size: 28px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 12px 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.company-description {
    font-size: 16px;
    line-height: 1.6;
    color: #4b5563;
    max-width: 650px;
}

.company-socials {
    display: flex;
    gap: 8px; /* Tighter gap */
}
.company-social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #eff6ff; /* Light blue */
    color: #2563eb; /* Blue Icon */
    border-radius: 8px;
    transition: all 0.2s;
}
.company-social-icon:hover {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.company-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 60px;
    padding-bottom: 0;
    border-bottom: none; 
}

.company-meta-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px; /* Soft round */
    font-size: 14px;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.meta-icon {
    width: 18px;
    height: 18px;
    color: #9ca3af; /* Gray icon */
}
.company-meta-chip .label {
    display: inline;
    color: #6b7280; /* Lighter gray */
    font-weight: 400;
}
.company-meta-chip .val {
    font-weight: 500;
    color: #111827; /* Darker value */
}

/* Job Section Header */
.company-jobs-header {
    margin-bottom: 32px;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.company-jobs-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: #111827;
    margin: 0;
    letter-spacing: -0.01em;
}
.company-jobs-count {
    color: #6b7280;
    font-size: 15px;
}

/* Companies List Page */
.companies-page {
    font-family: var(--light-font);
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    color: var(--light-text-main);
}
.companies-hero {
    text-align: center;
    margin: 18px 0 28px;
}
.companies-hero h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px 0;
    color: #111827;
}
.companies-hero p {
    color: #4b5563;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.5;
    max-width: 720px;
}
.companies-count {
    font-weight: 600;
    color: var(--light-text-main);
    margin: 0 0 16px 0;
}
.companies-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 18px;
}
.company-list-card {
    background: #ffffff;
    border: 1px solid var(--light-border);
    border-radius: 16px;
    padding: 18px 20px;
    transition: all 0.2s ease;
}
.company-list-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    border-color: #d1d5db;
}
.company-card-link {
    text-decoration: none;
    color: inherit;
    display: grid;
    grid-template-columns: 40px 64px 1fr auto;
    align-items: center;
    gap: 16px;
}
.company-rank {
    font-weight: 700;
    color: #6b7280;
    font-size: 18px;
    text-align: right;
}
.company-card-logo .job-logo {
    width: 56px;
    height: 56px;
}
.company-card-main {
    min-width: 0;
}
.company-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}
.company-card-meta {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}
.company-card-desc {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
}
.company-card-jobs {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    background: #eef2ff;
    border-radius: 999px;
    padding: 6px 10px;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .company-card-link {
        grid-template-columns: 28px 56px 1fr;
        grid-template-rows: auto auto;
    }
    .company-card-jobs {
        grid-column: 3 / 4;
        justify-self: start;
        margin-top: 10px;
    }
}

@media (max-width: 820px) {
    .job-card-link {
        flex-direction: column;
        align-items: flex-start;
    }
    .supabase-job-card {
        padding: 18px;
    }
    .job-footer {
        width: 100%;
        align-items: flex-start;
        margin-left: 0;
        min-width: 0;
    }
    .job-badges { flex-wrap: wrap; }
}

@media (max-width: 640px) {
    .jobs-search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .jobs-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .companies-list {
        gap: 14px;
    }
    .company-card-link {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .company-rank {
        text-align: left;
    }
    .company-card-jobs {
        grid-column: auto;
        justify-self: start;
    }
}

@media (max-width: 768px) {
    .company-hero { flex-direction: column; }
    .company-hero-left { flex-direction: column; }
    .company-socials { margin-top: 10px; }
    .company-jobs-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
