
/* Modern Dubai Remote Jobs - Dark Mode + Mobile Optimized */

/* CSS Variables for Theme Support */
:root {
  /* Light theme colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dark theme colors */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #334155;
  --accent-color: #60a5fa;
  --accent-hover: #3b82f6;
  --success-color: #34d399;
  --warning-color: #fbbf24;
  --danger-color: #f87171;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header & Navigation */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.25rem;
}

.logo span {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent-color);
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 60px;
  height: 32px;
  position: relative;
}

.theme-toggle:hover {
  background: var(--accent-color);
}

.theme-toggle::before {
  content: '🌙';
  position: absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  font-size: 14px;
  transition: all 0.3s ease;
}

[data-theme="dark"] .theme-toggle::before {
  content: '☀️';
  left: 28px;
}

/* Hero Section */
.hero {
  background: var(--gradient);
  color: white;
  padding: 4rem 0;
  text-align: center;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* Filter Controls */
.filter-controls {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}

.filter-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.filter-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  min-height: 42px;
}

.filter-btn:hover {
  background: var(--accent-hover);
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.job-count {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Jobs Grid */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* Job Cards */
.job-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.job-header {
  margin-bottom: 1rem;
}

.job-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  margin-bottom: 0.5rem;
}

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

.job-company {
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent-color);
  margin-bottom: 0.75rem;
}

/* Job Meta */
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.job-meta span {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.job-meta .relevance-high {
  color: var(--success-color);
  font-weight: 600;
}

.job-meta .salary {
  color: var(--warning-color);
  font-weight: 600;
}

/* Job Description */
.job-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Job Tags */
.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

.tag.verified {
  background: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

.tag.ai-enhanced {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* Apply Button */
.apply-btn {
  background: var(--accent-color);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}

.apply-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.apply-btn::after {
  content: '→';
  transition: transform 0.2s ease;
}

.apply-btn:hover::after {
  transform: translateX(2px);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--accent-color);
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .navbar .container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .filter-controls {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .jobs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .job-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  footer .container {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .job-card {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
}

/* Accessibility */
@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;
  }
}

/* Focus Styles */
.filter-input:focus,
.filter-btn:focus,
.apply-btn:focus,
.theme-toggle:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .navbar,
  .filter-controls,
  footer,
  .apply-btn {
    display: none !important;
  }
  
  .job-card {
    break-inside: avoid;
    border: 1px solid #000;
    margin-bottom: 1rem;
  }
}


/* Fix light mode visibility issues */
:root {
  /* Ensure proper contrast in light mode */
  --text-primary: #1e293b !important;
  --text-secondary: #64748b !important;
  --text-muted: #94a3b8 !important;
}

/* Fix header layout - center the logo */
.navbar .container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.logo {
  text-align: center;
  text-decoration: none;
}

.nav-links {
  position: absolute;
  right: 0;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* Fix job tags spacing */
.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem !important;
  margin-bottom: 1rem;
}

.tag {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 50px !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  border: 1px solid var(--border-color) !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

.tag.verified {
  background: var(--success-color) !important;
  color: white !important;
  border-color: var(--success-color) !important;
}

.tag.ai-enhanced {
  background: var(--accent-color) !important;
  color: white !important;
  border-color: var(--accent-color) !important;
}

/* Fix apply button alignment */
.apply-btn {
  background: var(--accent-color) !important;
  color: white !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  transition: all 0.2s ease !important;
  border: none !important;
  cursor: pointer !important;
  width: 100% !important;
  justify-content: center !important;
  margin-top: 1rem !important;
}

/* Fix job meta text visibility */
.job-meta span {
  color: var(--text-secondary) !important;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem !important;
}

.job-meta .salary {
  color: var(--warning-color) !important;
  font-weight: 600 !important;
}

/* Ensure job description is visible */
.job-description {
  color: var(--text-secondary) !important;
  line-height: 1.6 !important;
  margin-bottom: 1rem !important;
  font-size: 0.875rem !important;
}

/* Fix job title and company visibility */
.job-title {
  color: var(--text-primary) !important;
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  line-height: 1.4 !important;
  display: block !important;
  margin-bottom: 0.5rem !important;
}

.job-company {
  color: var(--accent-color) !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  margin-bottom: 0.75rem !important;
}

/* Mobile responsive header */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
  }
  
  .nav-links {
    position: static;
    justify-content: center;
  }
}

/* Fix Dark Mode Text Visibility Issues */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9 !important;  /* Brighter white for job titles */
  --text-secondary: #cbd5e1 !important;  /* Lighter gray for meta */
  --text-muted: #94a3b8;
  --border-color: #334155;
  --accent-color: #60a5fa;
  --accent-hover: #3b82f6;
  --success-color: #34d399;
  --warning-color: #fbbf24;
  --danger-color: #f87171;
}

/* Force job title visibility in dark mode */
[data-theme="dark"] .job-title {
  color: #f1f5f9 !important;  /* Bright white */
  font-weight: 700 !important;  /* Make it bolder */
}

[data-theme="dark"] .job-company {
  color: #60a5fa !important;  /* Bright blue */
  font-weight: 600 !important;
}

[data-theme="dark"] .job-description {
  color: #cbd5e1 !important;  /* Light gray but visible */
}

[data-theme="dark"] .job-meta span {
  color: #cbd5e1 !important;  /* Light gray for meta */
}

/* Fix desktop grid alignment */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)) !important;
  gap: 1.5rem !important;
  margin-bottom: 3rem;
  align-items: start !important;  /* Align to top */
}

.job-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  height: fit-content !important;  /* Allow variable heights */
  display: flex;
  flex-direction: column;
}

/* Fix apply button - remove double arrows */
.apply-btn {
  background: var(--accent-color) !important;
  color: white !important;
  padding: 0.75rem 1.5rem !important;
  border-radius: 8px !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  transition: all 0.2s ease !important;
  border: none !important;
  cursor: pointer !important;
  width: 100% !important;
  justify-content: center !important;
  margin-top: auto !important;  /* Push to bottom */
}

.apply-btn::after {
  content: '' !important;  /* Remove the CSS arrow */
}

/* Enhanced dark mode contrast for job detail pages */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] .job-title {
  color: #f8fafc !important;  /* Even brighter white */
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

[data-theme="dark"] .job-header h1 {
  color: #f8fafc !important;
  font-size: 2rem !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .job-header h2 {
  color: #60a5fa !important;
  font-size: 1.5rem !important;
  font-weight: 600 !important;
}

/* Fix section headers in dark mode */
[data-theme="dark"] .section-header h2 {
  color: #f8fafc !important;
  font-weight: 700 !important;
}

/* Fix stats cards in dark mode */
[data-theme="dark"] .stat-number {
  color: #60a5fa !important;
  font-weight: 800 !important;
}

[data-theme="dark"] .stat-label {
  color: #cbd5e1 !important;
  font-weight: 500 !important;
}
.job-card {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.apply-btn {
    margin-top: auto;
}
/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .jobs-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
}
