/*
Theme Name: GulfWork
Theme URI: https://gulfwork.in
Author: Grok
Description: A mobile-first Gulf jobs WordPress theme designed exactly like the GulfWork.in app – social feed style job cards, country flags, hero banner, quick actions, and bottom navigation.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: gulfwork
Tags: job-board, mobile-first, custom-logo, custom-menu, featured-images, responsive-layout
*/

/* ========================================
   CSS Variables - Matching GulfWork App
======================================== */
:root {
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --green: #198754;
  --green-dark: #146c43;
  --red: #dc3545;
  --orange: #fd7e14;
  --yellow: #ffc107;
  --bg: #f0f2f5;
  --card-bg: #ffffff;
  --text: #1c1e21;
  --text-light: #65676b;
  --border: #e4e6eb;
  --header-height: 56px;
  --bottom-nav-height: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ========================================
   Reset & Base
======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  overflow-x: hidden;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ========================================
   Header
======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  height: var(--header-height);
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0d47a1;
  margin: 0;
  letter-spacing: -0.5px;
}

.site-title span {
  color: #f9a825;
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #f9a825, #ff8f00);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-actions a,
.header-actions button {
  color: #555;
  font-size: 20px;
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Country Flags Bar */
.country-flags {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: #fff;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.country-flags::-webkit-scrollbar {
  display: none;
}

.flag-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  transition: background 0.2s;
}

.flag-item:hover,
.flag-item.active {
  background: #e7f0ff;
  color: var(--primary);
}

.flag-item img,
.flag-emoji {
  font-size: 20px;
  line-height: 1;
}

/* ========================================
   Hero Banner
======================================== */
.hero-banner {
  margin: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #0277bd 100%);
  color: #fff;
  min-height: 160px;
  display: flex;
  align-items: center;
}

.hero-content {
  padding: 16px 18px;
  position: relative;
  z-index: 2;
  max-width: 60%;
}

.hero-content h2 {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 6px;
  color: #fff;
}

.hero-content h2 span {
  color: #69f0ae;
}

.hero-features {
  list-style: none;
  margin: 8px 0 12px;
  font-size: 12px;
}

.hero-features li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.hero-features li::before {
  content: "✓";
  color: #69f0ae;
  font-weight: 700;
}

.btn-explore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #fff !important;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.btn-explore:hover {
  background: var(--green-dark);
}

.hero-image {
  position: absolute;
  right: 0;
  bottom: 0;
  top: 0;
  width: 45%;
  background-size: cover;
  background-position: center;
  opacity: 0.9;
}

/* ========================================
   Quick Actions
======================================== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 12px;
  background: #fff;
  margin: 0 0 8px;
  overflow-x: auto;
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  min-width: 60px;
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
}

.qa-blue { background: linear-gradient(135deg, #42a5f5, #1e88e5); }
.qa-purple { background: linear-gradient(135deg, #ab47bc, #8e24aa); }
.qa-green { background: linear-gradient(135deg, #66bb6a, #43a047); }
.qa-orange { background: linear-gradient(135deg, #ffa726, #fb8c00); }
.qa-red { background: linear-gradient(135deg, #ef5350, #e53935); }
.qa-teal { background: linear-gradient(135deg, #26c6da, #00acc1); }

/* ========================================
   Category Tabs
======================================== */
.category-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.tab-item {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  border-radius: 20px;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-item.active,
.tab-item:hover {
  background: #e7f0ff;
  color: var(--primary);
}

.tab-item.active {
  border-bottom: 2px solid var(--primary);
  border-radius: 0;
  background: transparent;
}

/* ========================================
   Job Feed Cards (Social Style)
======================================== */
.job-feed {
  padding: 8px 0;
}

.job-card {
  background: var(--card-bg);
  margin-bottom: 8px;
  border-radius: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

@media (min-width: 600px) {
  .job-card {
    margin: 0 12px 12px;
    border-radius: var(--radius);
  }
}

.job-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
}

.company-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #e3f2fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--primary);
  flex-shrink: 0;
  overflow: hidden;
}

.company-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.company-info {
  flex: 1;
  min-width: 0;
}

.company-name {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-badge {
  color: var(--primary);
  font-size: 14px;
}

.company-meta {
  font-size: 12px;
  color: var(--text-light);
}

.follow-btn {
  background: #e7f0ff;
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
}

.follow-btn:hover {
  background: var(--primary);
  color: #fff;
}

.job-card-body {
  padding: 0 14px 10px;
}

.job-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.job-title .flag-icon {
  color: var(--red);
  font-size: 16px;
}

.job-excerpt {
  font-size: 13.5px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.45;
}

/* Job Vacancy Banner inside card */
.job-banner {
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
  background: linear-gradient(90deg, #b71c1c 0%, #0d47a1 100%);
  color: #fff;
  display: flex;
  min-height: 140px;
}

.job-banner-left {
  flex: 1;
  padding: 12px 14px;
}

.job-banner-left h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.job-list {
  font-size: 12px;
  font-weight: 600;
}

.job-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.job-list li::before {
  content: "✓";
  color: #69f0ae;
  font-weight: 800;
}

.job-banner-right {
  width: 42%;
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 10px;
}

.banner-badges {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.banner-badge {
  background: rgba(255,255,255,0.95);
  color: #1565c0;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
}

.btn-apply-banner {
  background: var(--red);
  color: #fff !important;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.btn-apply-banner:hover {
  background: #c62828;
}

/* Tags under banner */
.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-light);
}

.job-tags span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Engagement bar */
.job-engagement {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 0 14px;
  font-size: 12px;
  color: var(--text-light);
}

.job-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px 10px;
  gap: 4px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  padding: 8px 10px;
  border-radius: 6px;
  flex: 1;
  justify-content: center;
}

.action-btn:hover {
  background: #f0f2f5;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff !important;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.btn-whatsapp:hover {
  background: #1da851;
}

/* ========================================
   Bottom Navigation (Mobile)
======================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-light);
  padding: 6px 8px;
  min-width: 56px;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
  color: var(--primary);
}

.bottom-nav-item svg,
.bottom-nav-item .nav-icon {
  font-size: 22px;
  line-height: 1;
}

/* ========================================
   Promo Banner
======================================== */
.promo-banner {
  margin: 8px 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(90deg, #1565c0, #0d47a1);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 14px 16px;
  gap: 12px;
}

.promo-banner h3 {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.promo-banner p {
  font-size: 12px;
  opacity: 0.9;
}

.promo-banner .btn {
  background: var(--green);
  color: #fff !important;
  font-weight: 700;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 6px;
  white-space: nowrap;
  margin-left: auto;
}

/* ========================================
   Desktop Adjustments
======================================== */
@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .bottom-nav {
    display: none;
  }

  .quick-actions {
    grid-template-columns: repeat(6, 1fr);
    max-width: 800px;
    margin: 0 auto 12px;
    border-radius: var(--radius);
  }

  .job-feed {
    max-width: 680px;
    margin: 0 auto;
  }

  .hero-banner {
    max-width: 800px;
    margin: 16px auto;
  }

  .category-tabs {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .site-header {
    box-shadow: var(--shadow-md);
  }

  .header-inner {
    max-width: 1100px;
    margin: 0 auto;
  }
}

/* ========================================
   WordPress Core Compatibility
======================================== */
.alignleft { float: left; margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }
.aligncenter { display: block; margin: 0 auto; }

.wp-caption {
  max-width: 100%;
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: #fff;
  border-radius: 8px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
}

.page-numbers.current,
.page-numbers:hover {
  background: var(--primary);
  color: #fff;
}
