/* =============================================
   JobHub Aggregator - Modern Clean Styles
   ============================================= */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ========== Header ========== */
.header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span {
    color: var(--primary);
}

.logo .site-logo-img,
.site-logo-img {
    height: 36px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    display: block;
}

footer.site-footer .logo .site-logo-img {
    height: 40px;
    max-width: 200px;
}

.nav {
    display: flex;
    gap: 24px;
    align-items: center;
}

.nav a {
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav a:hover {
    color: var(--primary);
    text-decoration: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
    color: white;
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-outline:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    color: white;
    text-decoration: none;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* ========== Hero / Search ========== */
.hero {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 48px 20px 56px;
    text-align: center;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero p {
    opacity: 0.9;
    margin-bottom: 28px;
    font-size: 1.1rem;
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 8px;
    display: flex;
    gap: 8px;
    box-shadow: var(--shadow-lg);
}

.search-box input,
.search-box select {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 0.95rem;
    border-radius: 8px;
    outline: none;
    color: var(--gray-900);
}

.search-box input {
    min-width: 180px;
}

.search-box select {
    background: var(--gray-50);
    max-width: 160px;
}

.search-box .btn {
    padding: 12px 24px;
    white-space: nowrap;
}

/* ========== Main Content ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.results-count {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* ========== Filters ========== */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filters select {
    padding: 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: var(--gray-700);
    outline: none;
}

.filters select:focus {
    border-color: var(--primary);
}

/* ========== Job Cards ========== */
.jobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.job-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 22px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.job-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.job-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.job-type {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
}

.job-type.remote {
    background: #d1fae5;
    color: #065f46;
}

.job-type.contract {
    background: #fef3c7;
    color: #92400e;
}

.job-type.internship {
    background: #ede9fe;
    color: #5b21b6;
}

.job-type.part-time {
    background: #fce7f3;
    color: #9d174d;
}

.job-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 6px;
    line-height: 1.3;
}

.job-title a {
    color: inherit;
}

.job-title a:hover {
    color: var(--primary);
    text-decoration: none;
}

.job-company {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.job-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.job-description {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-bottom: 16px;
    flex-grow: 1;
}

.job-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--gray-100);
}

.job-salary {
    font-weight: 600;
    color: var(--success);
    font-size: 0.95rem;
}

.job-date {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ========== Single Job Page ========== */
.job-detail {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 36px;
    max-width: 800px;
    margin: 0 auto;
}

.job-detail-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gray-200);
}

.job-detail h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.job-detail .company {
    font-size: 1.15rem;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.job-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.95rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.job-detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 28px 0 12px;
    color: var(--gray-900);
}

.job-detail p,
.job-detail ul {
    color: var(--gray-700);
    margin-bottom: 12px;
}

.job-detail ul {
    padding-left: 20px;
}

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

/* ========== Admin ========== */
.admin-table {
    width: 100%;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    border-collapse: collapse;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.admin-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--gray-50);
}

.form-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    padding: 32px;
    max-width: 700px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

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

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 36px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    background: white;
    border: 1px solid var(--gray-200);
}

.pagination a:hover {
    background: var(--gray-50);
    text-decoration: none;
}

.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--gray-700);
}

/* ========== Site Footer (4 columns) ========== */
footer.site-footer {
    background: #0f172a !important;
    color: #94a3b8 !important;
    margin-top: 64px;
    font-size: 0.9rem;
    width: 100%;
    display: block;
}

footer.site-footer a {
    color: #94a3b8 !important;
    text-decoration: none !important;
    transition: color 0.15s ease;
}

footer.site-footer a:hover {
    color: #ffffff !important;
    text-decoration: none !important;
}

footer.site-footer .footer-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 36px;
    display: grid !important;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    box-sizing: border-box;
}

footer.site-footer .footer-brand .logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

footer.site-footer .footer-brand .logo span {
    color: #60a5fa !important;
}

footer.site-footer .footer-brand p {
    line-height: 1.7;
    margin: 0 0 18px 0;
    max-width: 280px;
    color: #94a3b8 !important;
}

footer.site-footer .footer-social {
    display: flex !important;
    gap: 10px;
    flex-wrap: wrap;
}

footer.site-footer .footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #1e293b !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8 !important;
    text-decoration: none !important;
}

footer.site-footer .footer-social a:hover {
    background: #2563eb !important;
    color: #ffffff !important;
}

footer.site-footer .footer-col h4 {
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    letter-spacing: 0.02em;
}

footer.site-footer .footer-col ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

footer.site-footer .footer-col li {
    margin: 0 0 10px 0;
    padding: 0;
}

footer.site-footer .footer-col li a {
    display: inline-block;
    color: #94a3b8 !important;
}

footer.site-footer .footer-col li a:hover {
    color: #ffffff !important;
}

footer.site-footer .footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 18px 20px;
    background: #0f172a;
}

footer.site-footer .footer-bottom-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: #64748b !important;
}

footer.site-footer .footer-bottom-links {
    display: flex !important;
    gap: 20px;
}

footer.site-footer .footer-bottom-links a {
    color: #64748b !important;
}

footer.site-footer .footer-bottom-links a:hover {
    color: #ffffff !important;
}

/* Simple admin footer (keep light) */
.footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 24px 20px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 48px;
}


/* ========== Homepage layout + sidebar ========== */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
    align-items: start;
    padding-top: 28px;
}

.home-main {
    min-width: 0;
}

.jobs-grid-home {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.home-sidebar {
    position: sticky;
    top: 80px;
}

.side-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 16px;
}

.side-card h3 {
    font-size: 0.95rem;
    margin: 0 0 14px;
    color: var(--gray-900);
}

.side-empty {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin: 0;
}

.side-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-list li {
    border-bottom: 1px solid var(--gray-100);
}

.side-list li:last-child {
    border-bottom: none;
}

.side-job-link {
    display: block;
    padding: 10px 0;
    text-decoration: none !important;
    color: inherit;
}

.side-job-link:hover strong {
    color: var(--primary);
}

.side-job-link strong {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-900);
    line-height: 1.35;
    margin-bottom: 3px;
}

.side-meta {
    display: block;
    font-size: 0.78rem;
    color: var(--gray-500);
}

.side-views {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.side-more {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.side-type-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.side-type-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
}

.side-type-list li:last-child a {
    border-bottom: none;
}

.side-type-list a:hover {
    color: var(--primary);
}

.side-type-list span {
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.side-cta p {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin: 0 0 12px;
}

@media (max-width: 960px) {
    .home-layout {
        grid-template-columns: 1fr;
    }

    .home-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .home-sidebar .side-card {
        margin-bottom: 0;
    }
}

@media (max-width: 600px) {
    .home-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
    footer.site-footer .footer-main {
        grid-template-columns: 1fr 1fr !important;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.6rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box select {
        max-width: 100%;
    }
    
    .jobs-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .job-detail {
        padding: 24px 18px;
    }
    
    .admin-table {
        font-size: 0.85rem;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 10px 12px;
    }

    footer.site-footer .footer-main {
        grid-template-columns: 1fr !important;
        gap: 28px;
        padding: 36px 20px 28px;
    }

    footer.site-footer .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }
}


/* Structured job description */
.job-body { line-height: 1.65; color: var(--gray-800, #1e293b); }
.job-body h3 {
    font-size: 1.05rem;
    margin: 1.4em 0 0.5em;
    color: var(--gray-900, #0f172a);
    padding-bottom: 0.25em;
    border-bottom: 1px solid var(--gray-200, #e2e8f0);
}
.job-body h3:first-child { margin-top: 0; }
.job-body p { margin: 0 0 0.85em; }
.job-body ul, .job-body ol { margin: 0 0 1em; padding-left: 1.25rem; }
.job-body li { margin-bottom: 0.35em; }
.job-body li::marker { color: #2563eb; }
