/* ============================================
   Remote Jobs Directory - Modern Responsive CSS
   remotejobsdirectory.com
   ============================================ */

:root {
  --primary: #0f766e;
  --primary-dark: #0d9488;
  --primary-light: #14b8a6;
  --accent: #f59e0b;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --success: #22c55e;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.15);
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--accent);
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}
.logo span { color: var(--primary-light); }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  flex-wrap: wrap;
}
.nav-menu a {
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  color: var(--primary-light);
  background: rgba(20, 184, 166, 0.1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Main content wrapper */
.main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 1.5rem 4rem;
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.15) 0%, transparent 70%);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}
.hero-cta {
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
  border: none;
  cursor: pointer;
  font-size: 1rem;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--shadow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(15, 118, 110, 0.4);
}
.btn-outline {
  background: transparent;
  color: var(--primary-light);
  border: 2px solid var(--primary-light);
}
.btn-outline:hover {
  background: rgba(20, 184, 166, 0.15);
  transform: translateY(-2px);
}

/* Section titles */
.section-title {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}
.section-subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

/* Search bar */
.search-bar {
  max-width: 640px;
  margin: 0 auto 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.search-bar input {
  flex: 1;
  min-width: 180px;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text);
  font-size: 1rem;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar select {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}
.search-bar .btn { flex-shrink: 0; }

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition);
}
.card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.card a {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

/* Job listing cards */
.job-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.job-card .job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.job-card .job-date-pay {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0 0;
}
.job-card .job-date-pay .job-pay { color: var(--primary-light); }
.job-card .job-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(20, 184, 166, 0.2);
  color: var(--primary-light);
}
.tag-company { background: rgba(245, 158, 11, 0.2); color: var(--accent); }

/* Company directory */
.company-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.company-logo {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary-light);
  flex-shrink: 0;
}
.company-card h3 { margin-bottom: 0.25rem; }
.company-card p { font-size: 0.9rem; }

/* Blog */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition);
}
.blog-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}
.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--bg-dark);
}
.blog-card .blog-body { padding: 1.25rem; }
.blog-card .blog-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.blog-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.blog-card p { color: var(--text-muted); font-size: 0.95rem; }

/* Category pills */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.category-pills a {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.category-pills a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
  transition: all var(--transition);
}
.pagination a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}
.pagination .current {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Footer */
.site-footer {
  margin-top: 4rem;
  padding: 3rem 1.5rem 2rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-inner h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.footer-inner ul { list-style: none; }
.footer-inner li { margin-bottom: 0.5rem; }
.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--primary-light); }
.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Page header */
.page-header {
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb span { color: var(--primary-light); }

/* Filters row */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}
.filters-row select {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
}

/* Utility */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 2rem; }

/* Responsive */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 1rem;
  }
  .nav-menu.is-open { display: flex; }
  .hero { padding: 2rem 1rem 3rem; }
  .search-bar { flex-direction: column; }
  .search-bar input,
  .search-bar select { width: 100%; }
  .job-card { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .main-wrap { padding: 1rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
}

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* Apply modal */
.apply-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.apply-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}
.apply-modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.apply-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.apply-modal-header h2 { font-size: 1.2rem; margin: 0; }
.apply-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.apply-modal-close:hover { color: var(--text); }
.apply-modal form { padding: 1.5rem; }
.apply-modal label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}
.apply-modal input[type="text"],
.apply-modal input[type="email"],
.apply-modal input[type="url"],
.apply-modal textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1rem;
  font-family: inherit;
}
.apply-modal textarea { min-height: 100px; resize: vertical; }
.apply-modal .form-row { display: flex; gap: 0.75rem; }
.apply-modal .form-row > * { flex: 1; }
.apply-modal .apply-job-info {
  font-size: 0.9rem;
  color: var(--primary-light);
  margin-bottom: 1rem;
  padding: 0.5rem 0;
}
.apply-modal .btn-block { width: 100%; margin-top: 0.5rem; }
.apply-modal-success {
  padding: 1.5rem;
  text-align: center;
  color: var(--success);
  display: none;
}
.apply-modal-success.is-visible { display: block; }
.apply-modal form.is-hidden { display: none; }

/* Newsletter */
.newsletter-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
}
.newsletter-box h4 { margin-bottom: 0.5rem; font-size: 1rem; }
.newsletter-box p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; }
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  color: var(--text);
  font-size: 1rem;
}
.newsletter-form .btn { flex-shrink: 0; }
.newsletter-form .newsletter-msg { width: 100%; font-size: 0.9rem; margin-top: 0.5rem; }
.newsletter-form .newsletter-msg.success { color: var(--success); }
.newsletter-form .newsletter-msg.error { color: #ef4444; }
