/* ==========================================================================
   GOVISA GATEWAY WORKFORCE SOLUTIONS - COMPREHENSIVE RESPONSIVE STYLESHEET
   Carefully tuned media queries for seamless mobile, tablet, laptop, and desktop experiences
   Across all 27 pages, components, grids, sidebars, forms, and interactive widgets.
   ========================================================================== */

/* Global Fluid Resets */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
}

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

/* ==========================================================================
   1. LARGE DESKTOPS (1440px and up)
   ========================================================================== */
@media (min-width: 1440px) {
  :root {
    --container-max: 1360px;
    --section-pad-y: 72px;
    --section-pad-sm-y: 48px;
  }

  .hero-title {
    font-size: 3.4rem;
  }
}

/* ==========================================================================
   2. LAPTOPS & DESKTOPS (max-width: 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .mega-dropdown {
    width: 680px;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
  }
  
  .footer-grid {
    grid-template-columns: 1.3fr 0.85fr 1.3fr 1.15fr;
    gap: 28px;
  }

  .footer-brand-col {
    max-width: 100%;
  }
  
  .trust-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 24px;
  }
  
  .trust-stat-item:nth-child(3) {
    border-right: none;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .pipeline-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .team-strength-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   3. TABLETS & SMALL LAPTOPS (max-width: 992px)
   ========================================================================== */
@media (max-width: 992px) {
  :root {
    --section-pad-y: 48px;
    --section-pad-sm-y: 32px;
    --container-pad: 20px;
  }

  /* Header & Navigation */
  .nav-menu, .header-actions .btn-desktop {
    display: none !important;
  }

  .mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-xs);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    color: var(--text-dark);
    font-size: 1.2rem;
    cursor: pointer;
  }

  /* Top Bar */
  .top-bar-right {
    display: none;
  }

  .top-bar-left {
    justify-content: space-between;
    width: 100%;
  }

  /* Grids */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  /* Sidebar + Main Content Layouts (Service subpages, Job details, Country details, Article) */
  .grid[style*="grid-template-columns: 2fr 1fr"],
  .grid[style*="grid-template-columns: 1.5fr 1fr"],
  .grid[style*="grid-template-columns: 2.2fr 1fr"],
  .grid[style*="grid-template-columns: 1fr 2fr"],
  .service-layout-grid,
  .job-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .service-sidebar,
  .job-sidebar,
  .country-sidebar,
  .article-sidebar {
    position: static !important;
    top: auto !important;
    width: 100% !important;
  }

  /* Hero Section */
  .hero-carousel {
    height: 540px !important;
    min-height: 540px !important;
    position: relative;
    overflow: hidden;
  }

  .hero-slider-track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
  }

  .hero-content {
    max-width: 100%;
    padding: 20px 0;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-lead {
    font-size: 1rem;
  }

  /* Trust Bar */
  .trust-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .trust-stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 14px;
  }

  .trust-stat-item:last-child,
  .trust-stat-item:nth-last-child(2) {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Employer Portal Preview Mockup */
  .portal-metric-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .pipeline-steps {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Recruitment Process Timeline */
  .process-grid,
  .simple-process-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .govisa-flow-track {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 16px 12px !important;
  }

  .govisa-step-card {
    padding: 16px 10px !important;
  }

  .govisa-step-title {
    font-size: 0.74rem !important;
  }

  .govisa-step-desc {
    font-size: 0.72rem !important;
  }

  .team-strength-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Filter Systems */
  .filter-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Horizontal Filter Tabs (Countries, News, FAQs) */
  .filter-tabs,
  .region-tabs,
  .category-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    gap: 8px;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar,
  .region-tabs::-webkit-scrollbar,
  .category-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tab-btn,
  .category-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Page Banner */
  .page-banner {
    padding-top: 34px;
    padding-bottom: 34px;
  }

  .page-banner-overlay {
    background: linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.94) 0%,
      rgba(153, 0, 18, 0.88) 45%,
      rgba(153, 0, 18, 0.62) 100%
    );
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px 20px;
  }

  .footer-brand-col {
    grid-column: 1 / -1;
    max-width: 100%;
  }
}

/* ==========================================================================
   4. MOBILE DEVICES (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  :root {
    --container-pad: 16px;
    --section-pad-y: 38px;
    --section-pad-sm-y: 24px;
  }

  /* Top Bar */
  .top-bar-item:nth-child(3) {
    display: none; /* Hide email on small screens to fit license & phone */
  }

  /* Header */
  .header-inner {
    height: 64px;
  }

  .brand-logo-img {
    height: 38px;
    max-width: 160px;
  }

  .brand-name {
    font-size: 1.15rem;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.05rem;
  }

  .brand-tag {
    font-size: 0.65rem;
  }

  /* Grids - Stack to single column on mobile */
  .grid-2, .grid-3, .grid-4,
  .process-grid,
  .simple-process-grid,
  .team-strength-grid,
  .sector-feature-grid,
  .recruitment-category-grid,
  .recruitment-sectors-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  .govisa-flow-track {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
  }

  .team-card-row,
  .team-card-row.team-reverse {
    grid-template-columns: 1fr !important;
    padding: 28px 20px !important;
    gap: 24px !important;
  }

  .team-card-row.team-reverse .team-card-name,
  .team-card-row.team-reverse .team-card-degree,
  .team-card-row.team-reverse .team-card-role {
    text-align: left;
  }

  .team-card-row .team-card-photo,
  .team-card-row.team-reverse .team-card-photo {
    max-width: 190px;
    margin: 0 auto;
    order: -1;
  }

  /* Hero Section */
  .hero-carousel {
    height: 500px !important;
    min-height: 500px !important;
  }

  .hero-content {
    padding: 24px 0 36px;
  }

  .hero-title {
    font-size: 1.85rem;
    line-height: 1.25;
  }

  .hero-lead {
    font-size: 0.93rem;
    line-height: 1.6;
    margin-bottom: 20px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 12px;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-controls-container {
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
  }

  .hero-unified-nav {
    padding: 6px 12px;
    gap: 10px;
  }

  .hero-nav-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  /* Trust Credibility Bar */
  .trust-bar-section {
    margin-top: 0;
    padding-top: 20px;
  }

  .trust-bar-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }

  .trust-stats-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .trust-stat-item {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
  }

  .trust-stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Document & Editorial Pages (employers.html, training.html, csr.html) */
  .doc-page {
    padding: 0 4px;
  }

  .doc-figure {
    margin-bottom: 28px;
  }

  .doc-figure img {
    height: 240px;
  }

  .doc-h {
    font-size: 1.25rem;
    margin-top: 32px;
  }

  .doc-list-compact {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .doc-form-card {
    padding: 24px 18px;
  }

  .doc-form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Job Cards & Details */
  .job-card {
    padding: 20px 16px;
  }

  .job-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .job-card-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .job-card-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .job-meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Forms & Modals */
  .form-grid, .form-grid-3 {
    grid-template-columns: 1fr !important;
  }

  .form-group.col-span-2,
  .form-group.col-span-3 {
    grid-column: span 1 !important;
  }

  .form-card {
    padding: 24px 16px;
  }

  .modal-dialog {
    margin: 12px;
    max-width: calc(100vw - 24px);
    max-height: 90vh;
  }

  .modal-header {
    padding: 16px 18px;
  }

  .modal-body {
    padding: 18px 16px;
  }

  /* Employer Dashboard Card */
  .portal-preview-card {
    padding: 20px 16px;
  }

  .portal-metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .portal-metric-box {
    padding: 12px;
  }

  .portal-metric-val {
    font-size: 1.5rem;
  }

  /* Page Banner */
  .page-banner {
    padding-top: 44px;
    padding-bottom: 44px;
  }

  .page-banner h1 {
    font-size: 1.8rem;
  }

  .page-banner-lead {
    font-size: 0.95rem;
  }

  /* Section Headlines */
  .section-header {
    margin-bottom: 24px;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .section-lead {
    font-size: 0.95rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px;
  }

  .footer-logo img {
    height: 40px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .footer-legal-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Floating Widgets */
  .floating-actions {
    bottom: 16px;
    right: 16px;
    gap: 10px;
  }

  .floating-whatsapp {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }

  .floating-back-top {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }

  /* Notifications Toast */
  .toast-container {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }

  .toast {
    min-width: 100%;
    max-width: 100%;
  }
}

/* ==========================================================================
   5. SMALL PHONES (max-width: 420px)
   ========================================================================== */
@media (max-width: 420px) {
  .hero-title {
    font-size: 1.65rem;
  }

  .hero-eyebrow {
    font-size: 0.72rem;
    padding: 4px 10px;
  }

  .brand-logo-img {
    height: 32px;
    max-width: 135px;
  }

  .brand-tag {
    display: none;
  }

  .top-bar-left .top-bar-item:nth-child(2) {
    font-size: 0.72rem;
  }

  .license-pill {
    font-size: 0.68rem;
    padding: 2px 8px;
  }

  .page-banner h1 {
    font-size: 1.65rem;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .btn-lg {
    padding: 12px 18px;
    font-size: 0.88rem;
  }

  .btn {
    font-size: 0.85rem;
    padding: 10px 18px;
  }

  .service-card,
  .testimonial-card,
  .industry-card,
  .country-card-body {
    padding: 20px 14px;
  }

  .portal-metric-grid {
    grid-template-columns: 1fr;
  }

  .doc-contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ==========================================================================
   6. PRINT STYLES
   ========================================================================== */
@media print {
  .top-bar,
  .main-header,
  .hero-carousel,
  .floating-actions,
  .main-footer,
  .modal-backdrop,
  .toast-container {
    display: none !important;
  }

  body {
    background: #FFFFFF;
    color: #000000;
    font-size: 12pt;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .section {
    padding: 20px 0;
  }
}
