/* ===========================================
   EasyJob - Responsive Stylesheet
   Version: 3.0
   =========================================== */

/* ===== Small Phones (max-width: 480px) ===== */
@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }

  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  .btn-lg {
    padding: 0.75rem 1.25rem;
  }

  .job-card {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .job-card .job-meta {
    width: 100%;
    justify-content: space-between;
    margin-top: 0.75rem;
  }

  .filter-sidebar {
    padding: 1rem;
  }

  .footer-grid {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: 1rem;
    right: 1rem;
  }
}

/* ===== Phones (max-width: 640px) ===== */
@media (max-width: 640px) {
  .section {
    padding: 2rem 0;
  }

  .py-16 {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .py-12 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .mt-16 {
    margin-top: 2rem;
  }

  .mt-12 {
    margin-top: 1.5rem;
  }

  .gap-8 {
    gap: 1.5rem;
  }

  .gap-6 {
    gap: 1rem;
  }

  .text-3xl {
    font-size: 1.5rem;
  }

  .text-2xl {
    font-size: 1.25rem;
  }

  /* Hide on mobile */
  .hide-mobile {
    display: none !important;
  }

  /* Show on mobile */
  .show-mobile {
    display: flex !important;
  }

  /* Grid adjustments */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-grid {
    gap: 1.5rem;
  }

  /* Job Card Mobile */
  .job-card-content {
    flex-wrap: wrap;
  }

  .job-meta {
    width: 100%;
    justify-content: flex-start;
    margin-top: 0.5rem;
  }

  .job-meta-mobile {
    display: flex;
  }

  /* Page Header */
  .page-title {
    font-size: 1.5rem;
  }
}

/* ===== Tablets (max-width: 768px) ===== */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  /* Header */
  .header .nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .dark .header .nav {
    background: var(--gray-900);
  }

  .header .nav.active {
    max-height: 400px;
    opacity: 1;
    visibility: visible;
  }

  .header .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
  }

  .dark .header .nav-link {
    border-bottom-color: var(--gray-800);
  }

  .menu-toggle {
    display: flex;
  }

  /* Dropdown */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: 1rem;
    background: transparent;
    border: none;
  }

  /* Page Header */
  .page-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .page-header .btn {
    width: 100%;
  }

  /* Layout */
  .layout-sidebar {
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    order: 2;
    margin-top: 1.5rem;
  }

  .main-content {
    order: 1;
  }

  /* Filter toggle button for mobile */
  .filter-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 1rem;
  }

  .dark .filter-toggle {
    background: var(--gray-800);
    border-color: var(--gray-700);
    color: var(--gray-300);
  }

  .filter-sidebar {
    display: none;
  }

  .filter-sidebar.active {
    display: block;
  }

  /* Grid */
  .md-grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Pagination */
  .pagination .page-item:not(.active):not(:first-child):not(:last-child) {
    display: none;
  }

  .pagination .page-item.active + .page-item,
  .pagination .page-item:has(+ .active) {
    display: flex;
  }
}

/* ===== Small Laptops (max-width: 991px) ===== */
@media (max-width: 991px) {
  /* Layout with sidebar */
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .col-sidebar {
    order: 2;
  }

  .col-main {
    order: 1;
  }
}

/* ===== Tablets Landscape & Small Laptops (min-width: 768px) ===== */
@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }

  .md-flex { display: flex; }
  .md-hidden { display: none; }
  .md-block { display: block; }

  .md-flex-row { flex-direction: row; }

  .md-items-center { align-items: center; }
  .md-justify-between { justify-content: space-between; }

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

  .md-text-left { text-align: left; }

  .md-w-auto { width: auto; }

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

/* ===== Tablets Landscape (min-width: 768px) ===== */
@media (min-width: 768px) {
  /* Page Header */
  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  /* Footer Bottom */
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ===== Laptops (min-width: 1024px) ===== */
@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }

  .lg-flex { display: flex; }
  .lg-hidden { display: none; }
  .lg-block { display: block; }

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

  /* Layout with sidebar */
  .layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
  }

  .col-sidebar {
    order: 1;
  }

  .col-main {
    order: 2;
  }

  /* Filter sidebar always visible */
  .filter-toggle {
    display: none;
  }

  .filter-sidebar {
    display: block !important;
    position: sticky;
    top: 100px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}

/* ===== Large Screens (min-width: 1280px) ===== */
@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }

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

  .layout-grid {
    grid-template-columns: 300px 1fr;
    gap: 2rem;
  }
}

/* ===== Extra Large Screens (min-width: 1536px) ===== */
@media (min-width: 1536px) {
  .container {
    max-width: 1440px;
  }
}

/* ===== Print Styles ===== */
@media print {
  .header,
  .footer,
  .back-to-top,
  .theme-toggle,
  .filter-sidebar,
  .filter-toggle,
  .menu-toggle,
  .btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .job-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  a {
    text-decoration: underline;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
  :root {
    --primary: #0000ff;
    --gray-200: #000000;
    --gray-400: #000000;
  }

  .btn-primary {
    border: 2px solid currentColor;
  }

  .card,
  .job-card {
    border-width: 2px;
  }
}
