/* ===========================
   YoHire.in — Modern Job Board v2
   =========================== */

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --accent: #06b6d4;
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    max-width: 100%;
    overflow-x: hidden;
}

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

/* ===========================
   Header
   =========================== */
.header {
    background: rgba(255,255,255,0.95);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    text-decoration: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.logo p {
    display: none;
}

.header__nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header__badge {
    background: #eef2ff;
    color: var(--primary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #c7d2fe 100%);
    padding: 48px 0 40px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.hero__content {
    text-align: center;
    margin-bottom: 28px;
}

.hero__title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 8px;
}

.hero__subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
}

/* ===========================
   Search Box
   =========================== */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.search-box {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

.search-box__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 6px 6px 18px;
    box-shadow: var(--shadow-md);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box__inner:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1), var(--shadow-md);
}

.search-box__icon {
    color: var(--text-light);
    flex-shrink: 0;
    display: flex;
}

.search-box__input {
    flex: 1 1 200px;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: var(--text);
    padding: 10px 4px;
    font-family: var(--font);
}

.search-box__input::placeholder {
    color: var(--text-light);
}

.search-box__btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    flex-shrink: 0;
    font-family: var(--font);
}

.search-box__btn:hover { background: var(--primary-dark); }
.search-box__btn:active { transform: scale(0.97); }

.search-box__clear {
    color: var(--text-muted);
    font-size: 1rem;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 50%;
    transition: background 0.15s ease;
    flex-shrink: 0;
    line-height: 1;
}

.search-box__clear:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ===========================
   Main Content
   =========================== */
main {
    padding: 0 0 48px;
}

.jobs-section {
    background: transparent;
    padding: 0;
}

.stats {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stats strong {
    color: var(--primary);
    font-weight: 600;
}

.no-jobs {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.no-jobs__icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.no-jobs h2 {
    font-size: 1.4rem;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 600;
}

.no-jobs p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===========================
   Jobs Grid
   =========================== */
.jobs-grid {
    display: grid;
    gap: 16px;
}

.job-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: row;
    gap: 0;
}

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

.job-card .job-image {
    flex-shrink: 0;
    width: 140px;
    display: block;
    overflow: hidden;
}

.job-card .job-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.job-card:hover .job-image img {
    transform: scale(1.05);
}

.job-card__body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.job-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.job-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.job-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 4px;
}

.job-date {
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===========================
   Buttons
   =========================== */
.btn-primary,
.btn-secondary {
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: #f0f0ff;
}

/* ===========================
   Ad Cards
   =========================== */
.ad-card {
    padding: 16px 0;
}

/* ===========================
   Pagination
   =========================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}

.ellipsis {
    color: var(--text-light);
    margin: 0 2px;
}

/* ===========================
   Detail Page
   =========================== */
.job-detail {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.back-link:hover { color: var(--primary); }

.detail-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.detail-title {
    font-size: 1.6rem;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.detail-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg);
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.detail-content {
    margin-bottom: 32px;
    line-height: 1.8;
    color: var(--text);
    font-size: 0.95rem;
}

.detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 20px auto;
    display: block;
    border: 1px solid var(--border);
}

.detail-content h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-top: 24px;
    margin-bottom: 10px;
    font-weight: 600;
}

.detail-content ul, .detail-content ol {
    margin-left: 20px;
    margin-bottom: 16px;
}

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

.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 0.9rem;
}

.detail-content table td,
.detail-content table th {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.detail-content table tr:nth-child(even) { background: var(--bg); }

.detail-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.job-image-large {
    margin: 24px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.job-image-large img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
}

/* ===========================
   Footer
   =========================== */
.footer {
    background: var(--text);
    color: var(--text-light);
    padding: 28px 0;
}

.footer__inner {
    text-align: center;
}

.footer__brand {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: #e2e8f0;
}

.footer__brand strong {
    color: #fff;
    font-weight: 700;
}

.footer__copy {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
}

/* ===========================
   Ad Slots (responsive)
   =========================== */
.ad-slot {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.ad-slot iframe,
.ad-slot img,
.ad-slot ins,
.ad-slot > div {
    max-width: 100% !important;
    height: auto;
}

@media (max-width: 760px) {
    .ad-slot-top,
    .ad-slot-bottom {
        display: none !important;
    }
}

.ad-slot-mid { max-width: 300px; width: 100%; }
.ad-slot-native { width: 100%; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 768px) {
    .header { padding: 12px 0; }
    .logo h1 { font-size: 1.2rem; }
    .header__badge { font-size: 0.7rem; padding: 4px 10px; }
    
    .hero { padding: 32px 0 28px; }
    .hero__title { font-size: 1.5rem; }
    .hero__subtitle { font-size: 0.9rem; }
    
    .job-card { flex-direction: column; }
    .job-card .job-image { width: 100%; height: 160px; }
    .job-card .job-image img { height: 160px; }
    .job-card__body { padding: 16px; }
    .job-title { font-size: 0.95rem; }
    
    .job-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
    
    .job-detail { padding: 24px 16px; }
    .detail-title { font-size: 1.3rem; }
    .detail-actions { flex-direction: column; }
    .detail-actions .btn-primary,
    .detail-actions .btn-secondary { width: 100%; justify-content: center; }
    
    .pagination { gap: 4px; }
    .page-link { padding: 6px 10px; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .hero__title { font-size: 1.3rem; }
    .logo h1 { font-size: 1.1rem; }
    .job-title { font-size: 0.9rem; }
    .search-box__btn { padding: 9px 14px; font-size: 0.8rem; }
}

/* ===========================
   Smartlink Card (looks like a job card)
   =========================== */
.smartlink-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: var(--radius-md);
    padding: 18px 22px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

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

.smartlink-card__icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.smartlink-card__text strong {
    font-size: 0.95rem;
    color: var(--primary-dark);
}

.smartlink-card__text small {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ===========================
   Ad Responsive Guard
   Prevents ads from forcing desktop zoom on mobile
   =========================== */
.ad-responsive {
    max-width: 100% !important;
    overflow: hidden !important;
}

.ad-responsive iframe,
.ad-responsive img,
.ad-responsive ins,
.ad-responsive > div,
.ad-responsive > script + div {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* Force ad iframes to not exceed viewport */
.ad-responsive iframe {
    transform-origin: top left;
}

@media (max-width: 760px) {
    .ad-slot-leaderboard {
        display: none !important;
    }
    /* Scale down 300x250 if needed */
    .ad-slot-mid iframe {
        max-width: 100% !important;
    }
}

@media (max-width: 320px) {
    .ad-slot-mid {
        transform: scale(0.9);
        transform-origin: center top;
    }
}

/* ===========================
   Ad Card in grid
   =========================== */
.ad-card {
    grid-column: 1 / -1;
    padding: 12px 0;
    display: flex;
    justify-content: center;
}


/* Auth Header Buttons */
.header__btn { padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: all 0.15s; display: inline-block; }
.header__btn--primary { background: #4f46e5; color: #fff; }
.header__btn--primary:hover { background: #3730a3; color: #fff; }
.header__btn--ghost { color: #64748b; }
.header__btn--ghost:hover { color: #1e293b; background: #f1f5f9; }
.header__btn--outline { color: #4f46e5; border: 1px solid #e2e8f0; }
.header__btn--outline:hover { background: #f8fafc; }

/* Job Action Buttons */
.job-action-btn { cursor: pointer; transition: all 0.15s; }
.job-action-btn--saved { background: #10b981 !important; color: #fff !important; border-color: #10b981 !important; }
.job-action-btn--applied { background: #6366f1 !important; color: #fff !important; border-color: #6366f1 !important; }
