/* ===================================================================
   ApplyTasks - Custom Stylesheet
   Color Tone: Green (#10b981 / #047857), White (#ffffff), Black (#0f172a / #000)
   Mobile & PC Optimized
=================================================================== */

/* Local Self-Hosted Inter Font (Variable Weight 400..900) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --primary-green: #047857; /* WCAG AA & AAA accessible (5.48:1 with white) */
    --primary-green-hover: #065f46;
    --dark-green: #064e3b;
    --light-green: #ecfdf5;
    --green-border: #a7f3d0;
    
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-slate: #f1f5f9;
    
    --text-black: #0f172a;
    --text-dark: #1e293b;
    --text-muted: #475569; /* WCAG accessible (5.37:1 with white) */
    --border-color: #e2e8f0;
    
    --pure-black: #000000;
    --dark-card: #111827;
    --gold: #b45309; /* Accessible amber on white (5.02:1) */
    --danger: #b91c1c;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius: 10px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);
}

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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-green-hover);
}

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

/* Screen reader only utility class for accessible form labels */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===================================================================
   Navbar & Header
=================================================================== */
.site-header {
    background-color: var(--dark-card);
    border-bottom: 3px solid var(--primary-green);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.header-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.container-ad-top,
.container-ad-bottom {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    overflow: hidden;
    text-align: center;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 800;
    color: var(--bg-white);
    letter-spacing: -0.5px;
    text-decoration: none;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    max-width: 175px;
    display: block;
    object-fit: contain;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.brand-logo:hover .brand-logo-img {
    transform: scale(1.02);
    filter: brightness(1.06);
}

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

.brand-logo .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--primary-green);
    color: var(--bg-white);
    border-radius: 8px;
    font-size: 20px;
}

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

.nav-link {
    color: #cbd5e1;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--bg-white);
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-btn {
    background-color: var(--primary-green);
    color: var(--bg-white) !important;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.nav-btn:hover {
    background-color: var(--primary-green-hover);
    color: var(--bg-white) !important;
    transform: translateY(-1px);
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--bg-white);
    font-size: 26px;
    cursor: pointer;
}

/* ===================================================================
   Ad Containers (Ad-Friendly Styling)
=================================================================== */
.ad-slot-wrapper {
    margin: 20px auto;
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    clear: both;
}

.ad-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 5px;
    font-weight: 600;
}

.ad-box {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.ad-box a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    box-sizing: border-box;
}

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

/* Screen reader only utility class for accessible form labels */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ad-leaderboard {
    min-height: 90px;
    width: 728px;
    max-width: 100%;
}

.ad-mobile {
    display: none;
    min-height: 50px;
    width: 320px;
    max-width: 100%;
}

.ad-sidebar {
    width: 300px;
    max-width: 100%;
    min-height: 250px;
    margin: 15px auto;
}

.ad-video-wrapper {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    margin: 20px 0;
}

.ad-video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 ratio */
    background: #000;
}

.ad-video-container iframe,
.ad-video-container video,
.ad-video-container .video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #064e3b);
    text-align: center;
    padding: 20px;
}

.video-play-btn {
    width: 65px;
    height: 65px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    margin-bottom: 12px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
    transition: transform 0.2s ease;
}

.video-play-btn:hover {
    transform: scale(1.08);
}

/* ===================================================================
   Hero Section
=================================================================== */
.hero-section {
    background-color: var(--dark-card);
    color: var(--bg-white);
    padding: 40px 0 20px;
    border-bottom: 1px solid #1f2937;
}

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

.hero-banner-picture {
    display: block;
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid #1e293b;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    background-color: #0f172a;
    aspect-ratio: 1200 / 420;
}

.hero-banner-picture img {
    width: 100%;
    display: block;
    height: 100%;
    object-fit: cover;
    content-visibility: auto;
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 15px;
    color: var(--bg-white);
}

.hero-title span {
    color: var(--primary-green);
}

.hero-subtitle {
    font-size: 17px;
    color: #94a3b8;
    margin-bottom: 25px;
}

/* ===================================================================
   Search & Filter Bar
=================================================================== */
.search-filter-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin: -30px auto 30px;
    max-width: 1160px;
    position: relative;
    z-index: 10;
}

.filter-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 15px;
    align-items: center;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-black);
    background-color: var(--bg-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.btn-primary {
    background-color: var(--primary-green);
    color: var(--bg-white);
    font-weight: 600;
    padding: 12px 22px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover,
a.btn-primary:hover {
    background-color: var(--dark-card) !important;
    color: #ffffff !important;
    border-color: var(--dark-card) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}

.btn-view-apply {
    background-color: var(--primary-green) !important;
    color: #ffffff !important;
    border: 2px solid var(--primary-green) !important;
    font-weight: 700;
    white-space: nowrap !important;
    transition: all 0.2s ease;
}

.btn-view-apply:hover,
a.btn-view-apply:hover {
    background-color: var(--dark-card) !important;
    color: #ffffff !important;
    border-color: var(--primary-green) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35) !important;
}

.btn-outline {
    background-color: transparent;
    color: var(--dark-green);
    border: 2px solid var(--primary-green);
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-outline:hover {
    background-color: var(--primary-green);
    color: var(--bg-white);
}

.btn-black {
    background-color: var(--dark-card);
    color: var(--bg-white);
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-black:hover {
    background-color: var(--pure-black);
    color: var(--primary-green);
}

/* ===================================================================
   Tasks Grid & Cards
=================================================================== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-black);
}

.section-title span {
    color: var(--primary-green);
}

.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.task-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--green-border);
}

.task-card-img-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #0f172a;
}

.task-card-img-wrapper picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.task-card:hover .task-card-img-wrapper picture img {
    transform: scale(1.04);
}

.task-badge-cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    border-left: 3px solid var(--primary-green);
}

.task-badge-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-active {
    background-color: #047857;
    color: #ffffff;
}

.status-closed {
    background-color: #b91c1c;
    color: #ffffff;
}

.task-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.task-budget {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark-green);
    margin-bottom: 8px;
}

.task-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-black);
    line-height: 1.35;
    margin-bottom: 10px;
}

.task-title a {
    color: var(--text-black);
}

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

.task-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
    flex: 1;
}

.task-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.skill-tag {
    background: var(--light-green);
    color: var(--dark-green);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid var(--green-border);
}

/* ===================================================================
   Top Freelancing Categories Pills & Mobile Collapsible
=================================================================== */
.category-pills-section {
    margin: 10px 0 35px;
    width: 100%;
}

.category-toggle-btn {
    display: block;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    margin: 0 0 12px;
    text-align: left;
    font-family: inherit;
    cursor: default;
}

.category-toggle-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.category-toggle-pill {
    display: none;
}

.category-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.cat-pill-badge {
    padding: 7px 14px;
    font-size: 13px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-black);
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.cat-pill-badge:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: var(--light-green);
    transform: translateY(-1px);
}

.cat-pill-badge.active {
    background: var(--primary-green) !important;
    color: #ffffff !important;
    border-color: var(--primary-green) !important;
    font-weight: 700;
}

.cat-pill-badge.active span {
    color: #ffffff !important;
}

.cat-pill-icon {
    font-size: 14px;
    line-height: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-footer-meta {
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.deadline-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    color: #92400e; /* Accessible high-contrast amber/brown on white (7.09:1) */
}

.deadline-pill.expired {
    color: #b91c1c; /* Accessible high-contrast red on white (5.88:1) */
}

/* ===================================================================
   Winner Announcement Box (When deadline is hit)
=================================================================== */
.winner-announcement-card {
    background: linear-gradient(135deg, #064e3b 0%, #0f172a 100%);
    border: 2px solid var(--primary-green);
    border-radius: var(--radius);
    padding: clamp(20px, 4vw, 32px) clamp(16px, 3vw, 24px);
    color: #ffffff;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
    margin: 25px 0;
    word-break: break-word;
}

.winner-announcement-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.trophy-icon {
    font-size: 48px;
    margin-bottom: 10px;
    display: inline-block;
    animation: bounce 2s infinite ease-in-out;
    line-height: 1;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.winner-badge {
    background: var(--gold);
    color: #000;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 20px;
    display: inline-block;
    letter-spacing: 1px;
    margin-bottom: 12px;
    max-width: 100%;
}

.winner-name-display {
    font-size: clamp(22px, 5.5vw, 32px);
    font-weight: 900;
    color: #a7f3d0;
    letter-spacing: -0.5px;
    margin: 8px 0 12px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    word-break: break-word;
    overflow-wrap: break-word;
}

.winner-announcement-card p {
    font-size: 15px;
    color: #e2e8f0;
    max-width: 600px;
    margin: 0 auto 16px;
    line-height: 1.6;
    word-break: break-word;
}

.winner-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    color: #cbd5e1;
    max-width: 100%;
    margin: 10px auto 15px;
}

.winner-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ===================================================================
   Breadcrumb Navigation
=================================================================== */
.breadcrumb-nav {
    margin: 10px 0 15px;
    font-size: 13px;
    color: var(--text-muted);
    word-break: break-word;
    line-height: 1.6;
}

.breadcrumb-nav a {
    color: var(--text-muted);
}

.breadcrumb-nav a:hover {
    color: var(--primary-green);
}

.breadcrumb-nav strong {
    color: var(--text-dark);
}

/* ===================================================================
   Single Task Details & Layout
=================================================================== */
.task-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: 30px;
    margin-top: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.task-main-col {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.task-detail-picture {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    background-color: #0f172a;
    width: 100%;
}

.task-detail-picture picture,
.task-detail-picture img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: cover;
    display: block;
}

.task-detail-meta-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.task-detail-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-black);
    line-height: 1.3;
    margin-bottom: 12px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.task-detail-budget {
    font-size: 20px;
    font-weight: 800;
    color: var(--dark-green);
    margin-bottom: 25px;
}

.task-detail-subtitle {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-black);
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-green);
    padding-left: 10px;
}

.task-detail-desc {
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
    margin-bottom: 25px;
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* PDF Check Callout Banner */
.task-pdf-callout {
    background: #f8fafc;
    border: 2px dashed var(--primary-green);
    border-radius: 8px;
    padding: 24px 20px;
    text-align: center;
    margin: 30px 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.task-pdf-callout .pdf-callout-icon {
    font-size: 32px;
    margin-bottom: 8px;
    line-height: 1;
}

.task-pdf-callout h4 {
    font-size: 18px;
    color: var(--text-black);
    margin-bottom: 6px;
    font-weight: 700;
}

.task-pdf-callout p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 18px;
    line-height: 1.5;
}

.btn-pdf-cta {
    padding: 12px 28px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    color: #ffffff !important;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    box-sizing: border-box;
}

.btn-pdf-cta:hover,
a.btn-pdf-cta:hover {
    background-color: var(--primary-green-hover);
    color: #ffffff !important;
}

/* Nested Apply Box inside Task Main Column */
.task-main-col .apply-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: none;
    margin: 25px 0 10px;
}

/* Apply Call-to-Action Card (When apply has separate page) */
.apply-cta-card {
    background: #f8fafc;
    border: 2px solid var(--green-border);
    border-radius: var(--radius);
    padding: 26px;
    margin: 25px 0 10px;
    box-shadow: var(--shadow-sm);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
}

.apply-cta-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.apply-cta-icon {
    font-size: 32px;
    line-height: 1;
    background: var(--light-green);
    border: 1px solid var(--green-border);
    padding: 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apply-cta-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-black);
    margin-bottom: 6px;
}

.apply-cta-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

.apply-cta-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 18px 0 22px;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.cta-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-dark);
}

.cta-feature-check {
    color: var(--primary-green);
    font-weight: 800;
    font-size: 16px;
}

.apply-cta-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.apply-cta-buttons .btn-submit-app {
    flex: 1 1 240px;
}

.apply-cta-buttons .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    flex: 1 1 200px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: var(--text-dark);
    background: #ffffff;
    transition: all 0.2s ease;
}

.apply-cta-buttons .btn-outline:hover {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: var(--light-green);
}

.btn-submit-app {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.task-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.sidebar-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.sidebar-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-black);
    margin-bottom: 16px;
    border-bottom: 2px solid var(--light-green);
    padding-bottom: 8px;
}

.overview-list {
    list-style: none;
}

.overview-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    word-break: break-word;
}

.overview-list li strong {
    color: var(--text-black);
}

.overview-list li span {
    color: var(--text-muted);
}

/* ===================================================================
   PDF & Video Viewer Page (view.php)
=================================================================== */
.pdf-viewer-container {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.pdf-embed-box {
    width: 100%;
    height: 650px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    overflow: hidden;
    margin: 20px 0;
    background: #525659;
}

.pdf-embed-box iframe,
.pdf-embed-box embed {
    width: 100%;
    height: 100%;
    border: none;
}

/* Photo-like PDF Document Preview (Small Height) */
.pdf-photo-preview-card {
    display: block;
    text-decoration: none;
    color: inherit;
    margin: 20px 0 15px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.pdf-photo-preview-card:hover {
    border-color: var(--primary-green);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.12);
    transform: translateY(-2px);
}

.pdf-photo-sheet {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
    padding: 16px 20px;
    position: relative;
    max-height: 175px;
    overflow: hidden;
    border-top: 3px solid var(--primary-green);
    box-sizing: border-box;
}

.pdf-photo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
    margin-bottom: 10px;
    gap: 10px;
}

.pdf-photo-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #fee2e2;
}

.pdf-photo-ref {
    font-size: 11px;
    font-family: monospace;
    color: #64748b;
}

.pdf-photo-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-photo-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pdf-photo-meta-row {
    display: flex;
    gap: 15px;
    font-size: 11px;
    color: #64748b;
    flex-wrap: wrap;
}

.pdf-photo-meta-row strong {
    color: #0f172a;
}

.pdf-photo-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.88) 50%, #ffffff 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    pointer-events: none;
}

.pdf-photo-hint-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s ease, transform 0.2s ease;
}

.pdf-photo-preview-card:hover .pdf-photo-hint-pill {
    background: var(--primary-green);
    transform: scale(1.04);
}

/* ===================================================================
   Application Form Styling
=================================================================== */
.apply-box {
    background: var(--bg-white);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin: 25px 0;
}

.apply-box-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-black);
    margin-bottom: 8px;
}

.apply-box-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-black);
    margin-bottom: 6px;
}

.form-label span.req {
    color: var(--danger);
}

.phone-input-group {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 10px;
}

.file-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-zone:hover {
    border-color: var(--primary-green);
    background: var(--light-green);
}

.file-upload-zone input[type="file"] {
    display: block;
    width: 100%;
    font-size: 14px;
    color: var(--text-muted);
}

.file-tip {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ===================================================================
   Alerts & Notifications
=================================================================== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

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

/* ===================================================================
   Footer
=================================================================== */
.site-footer {
    background-color: var(--dark-card);
    color: #e2e8f0; /* Accessible high-contrast text on dark background (13.6:1) */
    border-top: 1px solid #1f2937;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 20px;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h3,
.footer-col h4,
.footer-heading {
    color: #ffffff;
    font-size: 16px;
    margin-bottom: 16px;
    font-weight: 700;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: #cbd5e1; /* High-contrast readable link text (11.95:1) */
    font-size: 14px;
}

.footer-col ul li a:hover {
    color: #34d399;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #94a3b8; /* High-contrast readable footer muted text (6.92:1) */
}

/* ===================================================================
   Responsive Mobile Optimization (Media Queries)
=================================================================== */
@media (max-width: 900px) {
    .section-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 14px !important;
        margin-bottom: 20px !important;
        width: 100% !important;
    }

    .section-header > div {
        width: 100% !important;
    }

    .section-header .btn-outline {
        white-space: nowrap !important;
        display: inline-flex !important;
        align-self: flex-start !important;
        padding: 9px 18px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
    }

    .task-detail-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 20px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .footer-top {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .hero-banner-picture {
        aspect-ratio: 600 / 420;
        margin-bottom: 20px;
    }

    .container-ad-top,
    .container-ad-bottom {
        padding: 0 12px;
        max-width: 100%;
        overflow: hidden;
    }

    .main-content {
        padding: 15px 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .header-container {
        height: 60px;
        padding: 0 14px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .brand-logo-img {
        height: 32px;
        max-width: 145px;
    }

    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background-color: var(--dark-card);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 2px solid var(--primary-green);
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }
    
    .main-nav.active {
        display: flex;
    }
    
    .ad-leaderboard {
        display: none !important;
    }
    
    .ad-mobile {
        display: inline-flex !important;
        width: 100% !important;
        max-width: 320px !important;
        min-height: auto;
        box-sizing: border-box !important;
    }

    .ad-sidebar {
        width: 100% !important;
        max-width: 300px !important;
        min-height: auto;
        box-sizing: border-box !important;
    }
    
    .ad-slot-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .ad-box {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    .ad-box a {
        display: inline-flex;
        max-width: 100%;
        box-sizing: border-box;
    }

    .ad-box img {
        max-width: 100% !important;
        height: auto !important;
        width: auto !important;
        object-fit: contain;
    }

    /* Task Detail Mobile Optimizations */
    .task-detail-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        gap: 16px;
    }

    .task-main-col {
        padding: 18px 14px;
        border-radius: 8px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .task-sidebar-col {
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
        gap: 16px;
    }

    .sidebar-card {
        padding: 18px 14px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .task-detail-picture {
        margin-bottom: 18px;
        border-radius: 6px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .task-detail-picture picture,
    .task-detail-picture img {
        max-height: 250px;
        width: 100% !important;
        max-width: 100% !important;
        object-fit: cover;
    }

    .task-detail-title {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 10px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .task-detail-budget {
        font-size: 18px;
        margin-bottom: 18px;
    }

    .task-detail-subtitle {
        font-size: 16px;
    }

    .task-detail-desc {
        font-size: 14px;
        line-height: 1.65;
        margin-bottom: 20px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .task-pdf-callout {
        padding: 18px 14px;
        margin: 20px 0;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .task-pdf-callout .btn-pdf-cta {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px 14px !important;
        font-size: 14px !important;
        white-space: normal !important;
        text-align: center !important;
        line-height: 1.35 !important;
        box-sizing: border-box !important;
    }

    .task-main-col .apply-box {
        padding: 18px 14px;
        margin: 20px 0 10px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .apply-box-title {
        font-size: 19px;
    }

    .apply-cta-card {
        padding: 18px 14px;
        margin: 20px 0 10px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .apply-cta-header {
        flex-direction: column;
        gap: 12px;
    }

    .apply-cta-title {
        font-size: 19px;
    }

    .apply-cta-buttons {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .apply-cta-buttons .btn-submit-app,
    .apply-cta-buttons .btn-outline {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto;
        white-space: normal !important;
        text-align: center;
        box-sizing: border-box !important;
    }

    .phone-input-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .phone-input-group select {
        max-width: 100%;
        width: 100%;
        font-size: 16px; /* Prevents auto zoom */
    }

    .form-control {
        font-size: 16px; /* Prevents auto-zoom on iOS */
        padding: 11px 12px;
    }

    .file-upload-zone {
        padding: 18px 12px;
    }

    .file-upload-zone input[type="file"] {
        font-size: 13px;
        max-width: 100%;
    }

    .btn-submit-app {
        font-size: 15px;
        padding: 13px;
    }

    /* Winner Card on Mobile */
    .winner-announcement-card {
        padding: 22px 14px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .winner-name-display {
        font-size: 24px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .winner-announcement-card p {
        font-size: 14px;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .winner-meta {
        flex-direction: column;
        gap: 6px;
        padding: 10px 14px;
        align-items: flex-start;
        border-radius: 8px;
    }

    .winner-meta span {
        white-space: normal;
        font-size: 12px;
    }

    .winner-announcement-card .btn-primary,
    .winner-announcement-card .btn-outline {
        width: 100% !important;
        max-width: 100% !important;
        display: block;
        padding: 12px;
        text-align: center;
        white-space: normal !important;
        box-sizing: border-box !important;
    }

    /* Sidebar on Mobile */
    .sidebar-card {
        padding: 18px 16px;
    }

    .overview-list li {
        font-size: 13px;
        gap: 6px;
    }
    
    .filter-form {
        grid-template-columns: 1fr;
    }
    
    .search-filter-card {
        margin-top: 10px;
    }

    /* Mobile Collapsible for Top Freelancing Categories: Collapsed by Default */
    .category-pills-section {
        margin: 5px 0 25px;
        background: #ffffff;
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        padding: 12px 14px;
        box-shadow: var(--shadow-sm);
    }

    .category-toggle-btn {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin: 0;
        cursor: pointer;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .category-toggle-title {
        font-size: 13px;
        font-weight: 700;
        color: var(--text-black);
        letter-spacing: 0.3px;
    }

    .category-toggle-pill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        font-weight: 700;
        color: var(--dark-green);
        background: var(--light-green);
        border: 1px solid var(--green-border);
        padding: 4px 10px;
        border-radius: 20px;
        transition: all 0.2s ease;
    }

    .category-toggle-arrow {
        display: inline-block;
        font-size: 11px;
        transition: transform 0.25s ease;
    }

    /* COLLAPSED BY DEFAULT ON MOBILE */
    .category-pills-container {
        display: none;
        padding-top: 14px;
        margin-top: 10px;
        border-top: 1px dashed var(--border-color);
        animation: fadeIn 0.2s ease-in-out;
    }

    /* EXPANDED ON MOBILE WHEN USER TAPS */
    .category-pills-section.is-open .category-pills-container {
        display: flex;
    }

    .category-pills-section.is-open .category-toggle-arrow {
        transform: rotate(180deg);
    }

    .category-pills-section.is-open .category-toggle-pill {
        background: var(--dark-card);
        color: var(--primary-green);
        border-color: var(--dark-card);
    }

    .cat-pill-badge {
        padding: 8px 12px;
        font-size: 13px;
    }

    .section-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 14px !important;
        margin-bottom: 20px !important;
        width: 100% !important;
    }

    .section-header > div {
        width: 100% !important;
        display: block !important;
    }

    .section-header .btn-outline {
        white-space: nowrap !important;
        display: inline-flex !important;
        align-self: flex-start !important;
        padding: 9px 18px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
        margin-top: 4px !important;
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .task-grid {
        grid-template-columns: 1fr;
    }
    
    .pdf-embed-box {
        height: 450px;
    }
}

/* Small Smartphone Optimization (<= 480px) */
@media (max-width: 480px) {
    .section-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        margin-bottom: 18px !important;
        width: 100% !important;
    }

    .section-header > div {
        width: 100% !important;
    }

    .section-header .btn-outline {
        white-space: nowrap !important;
        display: inline-flex !important;
        align-self: flex-start !important;
        padding: 8px 16px !important;
        font-size: 13px !important;
        flex-shrink: 0 !important;
        margin-top: 2px !important;
    }

    .container-ad-top,
    .container-ad-bottom {
        padding: 0 8px;
    }

    .main-content {
        padding: 12px 8px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .header-container {
        padding: 0 10px;
    }

    .task-main-col {
        padding: 14px 10px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .task-detail-picture {
        margin-bottom: 14px;
        border-radius: 4px;
    }

    .task-detail-picture picture,
    .task-detail-picture img {
        max-height: 200px;
    }

    .task-detail-title {
        font-size: 19px;
    }

    .task-main-col .apply-box {
        padding: 14px 10px;
        border-radius: 6px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .apply-box-title {
        font-size: 17px;
    }

    .sidebar-card {
        padding: 14px 10px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .task-pdf-callout {
        padding: 14px 10px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .task-pdf-callout .btn-pdf-cta {
        font-size: 13px !important;
        padding: 10px 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        white-space: normal !important;
        box-sizing: border-box !important;
    }

    .apply-cta-card {
        padding: 14px 10px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }

    .apply-cta-features {
        padding: 10px 10px;
    }

    .cta-feature-item {
        font-size: 13px;
    }

    .overview-list li {
        padding: 8px 0;
    }

    .trophy-icon {
        font-size: 38px;
    }

    .winner-badge {
        font-size: 11px;
        padding: 4px 12px;
    }

    .winner-name-display {
        font-size: 20px;
    }

    .winner-announcement-card {
        padding: 18px 10px;
        min-width: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden;
    }
}

/* ===================================================================
   Clean Responsive Pagination Component
=================================================================== */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 35px 0 25px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.pagination-info {
    font-size: 14px;
    color: #334155; /* High contrast text on white container (10.35:1) */
}

.pagination-info strong {
    color: #0f172a;
    font-weight: 700;
}

.pagination-wrapper nav {
    display: flex;
    align-items: center;
}

.pagination-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-nav li {
    display: inline-flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-nav a,
.pagination-nav span,
.pagination-nav .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    color: var(--text-black);
    background: #ffffff;
    transition: all 0.2s ease;
    text-decoration: none;
    user-select: none;
    line-height: 1;
}

.pagination-nav a:hover,
.pagination-nav .page-link:hover:not(.active):not(.disabled) {
    border-color: var(--primary-green);
    color: var(--primary-green);
    background: var(--light-green);
    transform: translateY(-1px);
}

.pagination-nav .active {
    background: var(--primary-green) !important;
    color: #ffffff !important;
    border-color: var(--primary-green) !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    font-weight: 700;
    cursor: default;
}

.pagination-nav .disabled {
    color: #475569 !important; /* Accessible text on #f8fafc (7.24:1 contrast ratio) */
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.9;
}

.pagination-nav .pagination-dots {
    border: none;
    background: transparent;
    min-width: 24px;
    padding: 0;
    color: var(--text-muted);
    font-weight: 700;
    cursor: default;
}

/* Mobile Pagination Responsive Optimizations */
@media (max-width: 768px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 14px;
        padding: 16px 12px;
        margin: 25px 0 15px;
    }

    .pagination-info {
        font-size: 13px;
        text-align: center;
        width: 100%;
    }

    .pagination-wrapper nav {
        width: 100%;
        justify-content: center;
    }

    .pagination-nav {
        justify-content: center;
        gap: 5px;
        width: 100%;
    }

    .pagination-nav a,
    .pagination-nav span,
    .pagination-nav .page-link {
        min-width: 36px;
        height: 36px;
        padding: 0 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .pagination-wrapper {
        padding: 14px 8px;
        gap: 12px;
        border-radius: 8px;
    }

    .pagination-nav {
        gap: 4px;
    }

    .pagination-nav a,
    .pagination-nav span,
    .pagination-nav .page-link {
        min-width: 32px;
        height: 34px;
        padding: 0 7px;
        font-size: 12px;
        border-radius: 4px;
    }

    .pagination-nav .pagination-dots {
        min-width: 18px;
        font-size: 12px;
    }
}

/* Mobile Photo Preview Adjustments */
@media (max-width: 768px) {
    .pdf-photo-preview-card {
        padding: 12px;
        margin: 15px 0 10px;
    }
    .pdf-photo-sheet {
        padding: 12px 14px;
        max-height: 160px;
    }
    .pdf-photo-title {
        font-size: 13px;
    }
    .pdf-photo-desc {
        font-size: 11px;
    }
    .pdf-photo-fade-overlay {
        height: 60px;
    }
    .pdf-photo-hint-pill {
        font-size: 10px;
        padding: 4px 10px;
    }

    .view-apply-cta-box {
        padding: 16px 14px !important;
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .view-apply-cta-btn-wrapper {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    .btn-view-apply {
        width: 100% !important;
        white-space: nowrap !important;
        font-size: clamp(12px, 3.6vw, 14px) !important;
        padding: 12px 10px !important;
        text-align: center !important;
        justify-content: center !important;
    }
}

