/*
Theme Name:  خادمتي - Khademati
Theme URI:   https://khademati.sa
Description: قالب متجر تأجير العمالة المنزلية — يدعم WooCommerce و Amelia Booking
Author:      خادمتي.sa
Author URI:  https://khademati.sa
Version:     1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License:     GPL-2.0-or-later
Text Domain: khademati
Tags: rtl-language, arabic, woocommerce, booking, e-commerce
*/

/* ===================================================
   CSS CUSTOM PROPERTIES
=================================================== */
:root {
  --green:        #1D9E75;
  --green-dark:   #0F6E56;
  --green-light:  #E1F5EE;
  --green-mid:    #5DCAA5;
  --text:         #1A1A1A;
  --text-muted:   #666;
  --text-light:   #999;
  --bg:           #FAFAF8;
  --surface:      #FFFFFF;
  --border:       #E8E8E4;
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    20px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,.08);
  --font-heading: 'Tajawal', 'Cairo', sans-serif;
  --font-body:    'Noto Sans Arabic', 'Tajawal', sans-serif;
  --transition:   0.22s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-dark); }

/* ===================================================
   TYPOGRAPHY
=================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.3rem; }

p { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* ===================================================
   LAYOUT UTILITIES
=================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ===================================================
   COMPONENTS — BUTTONS
=================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(29,158,117,.3);
}
.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-outline:hover {
  background: var(--green);
  color: #fff;
}
.btn-lg { padding: 1rem 2.5rem; font-size: 1.05rem; border-radius: var(--radius-lg); }
.btn-sm { padding: .5rem 1.25rem; font-size: .85rem; }
.btn-full { width: 100%; }

/* ===================================================
   COMPONENTS — CARDS
=================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--green-mid);
}
.card-body { padding: 1.25rem; }

/* Worker card */
.worker-card .card-img {
  position: relative;
  height: 200px;
  background: var(--green-light);
  overflow: hidden;
}
.worker-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.worker-card .availability-badge {
  position: absolute;
  top: .75rem;
  right: .75rem;
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-available { background: #EAF3DE; color: #3B6D11; }
.badge-busy      { background: #FCEBEB; color: #A32D2D; }
.badge-waitlist  { background: #FAEEDA; color: #854F0B; }

.worker-card .worker-name { font-size: 1rem; font-weight: 700; margin-bottom: .2rem; }
.worker-card .worker-meta { font-size: .82rem; color: var(--text-muted); margin-bottom: .6rem; }
.worker-card .stars { color: #BA7517; font-size: .85rem; margin-bottom: .75rem; }
.worker-card .price-row {
  display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.price-tag {
  font-size: .78rem;
  padding: .2rem .55rem;
  border-radius: 6px;
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 600;
}

/* ===================================================
   COMPONENTS — BADGES & PILLS
=================================================== */
.pill {
  display: inline-block;
  padding: .25rem .9rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--green-light);
  color: var(--green-dark);
}

/* ===================================================
   COMPONENTS — FORMS
=================================================== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.form-control {
  width: 100%;
  padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}
.form-control:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,158,117,.12);
}

/* ===================================================
   SITE HEADER
=================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: .9rem 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}
.site-logo span { color: var(--green); }

.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a {
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.main-nav a:hover, .main-nav a.active { color: var(--green); }

.header-actions { display: flex; align-items: center; gap: .75rem; }

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: .3rem;
}
.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-toggle { display: flex; }
}

/* ===================================================
   HERO SECTION
=================================================== */
.hero {
  padding: 6rem 0 4rem;
  background: linear-gradient(135deg, #F0FBF6 0%, #FAFAF8 60%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(29,158,117,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { max-width: 600px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--green-light);
  color: var(--green-dark);
  padding: .35rem 1rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.hero h1 { margin-bottom: 1.25rem; }
.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 480px;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 2.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.stat-item .stat-num {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--green);
  font-family: var(--font-heading);
}
.stat-item .stat-label {
  font-size: .82rem;
  color: var(--text-muted);
}

/* ===================================================
   SEARCH / FILTER BAR
=================================================== */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.filter-bar .search-input {
  flex: 1;
  min-width: 200px;
}
.filter-bar select {
  padding: .65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  direction: rtl;
}
.filter-bar select:focus {
  outline: none;
  border-color: var(--green);
}

/* ===================================================
   SECTION HEADERS
=================================================== */
.section-header { margin-bottom: 3rem; }
.section-header .section-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .5rem;
}
.section-header h2 { margin-bottom: .75rem; }
.section-header p { color: var(--text-muted); max-width: 560px; }

/* ===================================================
   BOOKING WIDGET
=================================================== */
.booking-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}
.booking-type-tabs {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: .3rem;
  margin-bottom: 1.5rem;
  gap: .25rem;
}
.booking-tab {
  flex: 1;
  padding: .65rem;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all var(--transition);
  font-family: var(--font-heading);
}
.booking-tab.active {
  background: var(--surface);
  color: var(--green);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.booking-summary {
  background: var(--green-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.5rem;
}
.summary-line {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  padding: .3rem 0;
  color: var(--text-muted);
}
.summary-line.total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-dark);
  border-top: 1px solid rgba(0,0,0,.08);
  margin-top: .5rem;
  padding-top: .75rem;
}

/* ===================================================
   AVAILABILITY CALENDAR
=================================================== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 1rem;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
}
.cal-day.available { background: var(--green-light); color: var(--green-dark); }
.cal-day.booked    { background: #F5F5F5; color: #bbb; cursor: not-allowed; }
.cal-day.selected  { background: var(--green); color: #fff; border-color: var(--green-dark); }
.cal-day.today     { border-color: var(--green); font-weight: 700; }

.time-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.time-slot {
  padding: .45rem;
  text-align: center;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: all var(--transition);
}
.time-slot.free:hover  { border-color: var(--green); color: var(--green); }
.time-slot.taken       { background: #F5F5F5; color: #bbb; cursor: not-allowed; text-decoration: line-through; }
.time-slot.chosen      { background: var(--green); color: #fff; border-color: var(--green); }

/* ===================================================
   PROFILE PAGE
=================================================== */
.worker-profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.worker-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--green-light);
  flex-shrink: 0;
}
.worker-info h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.worker-badges { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0; }
.worker-specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}
.spec-item { text-align: center; }
.spec-item .spec-val { font-size: 1.25rem; font-weight: 800; color: var(--green); }
.spec-item .spec-key { font-size: .78rem; color: var(--text-muted); }

/* Gallery */
.photo-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.photo-gallery img {
  border-radius: var(--radius-md);
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  transition: opacity var(--transition);
}
.photo-gallery img:hover { opacity: .85; }

/* Video */
.video-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16/9;
}
.video-wrapper iframe { width: 100%; height: 100%; border: none; }

/* ===================================================
   DASHBOARD / MY ACCOUNT
=================================================== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}
.dashboard-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: sticky;
  top: 90px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.sidebar-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--green-dark);
  font-size: 1.1rem;
}
.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.sidebar-nav li a:hover, .sidebar-nav li a.active {
  background: var(--green-light);
  color: var(--green-dark);
}
.sidebar-nav li a .nav-icon { font-size: 1.1rem; }

.booking-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: box-shadow var(--transition);
}
.booking-item:hover { box-shadow: var(--shadow-sm); }
.booking-item + .booking-item { margin-top: .75rem; }

.booking-status {
  padding: .25rem .75rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}
.status-upcoming  { background: #E1F5EE; color: #0F6E56; }
.status-completed { background: #E8E8E4; color: #555; }
.status-cancelled { background: #FCEBEB; color: #A32D2D; }

/* ===================================================
   FOOTER
=================================================== */
.site-footer {
  background: #111;
  color: #ccc;
  padding: 4rem 0 2rem;
}
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #2a2a2a;
}
.footer-brand .site-logo { color: #fff; font-size: 1.4rem; }
.footer-brand p { margin-top: .75rem; font-size: .88rem; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: .92rem; font-weight: 700; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a { color: #999; font-size: .88rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--green); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  font-size: .82rem;
  color: #666;
}
.payment-logos { display: flex; gap: .75rem; }
.payment-logo {
  background: #222;
  border-radius: 6px;
  padding: .25rem .75rem;
  font-size: .75rem;
  color: #aaa;
  font-weight: 600;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .worker-profile-header { flex-direction: column; }
  .worker-specs { grid-template-columns: repeat(2, 1fr); }
}

/* ===================================================
   WOOCOMMERCE OVERRIDES
=================================================== */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit {
  background: var(--green) !important;
  color: #fff !important;
  border-radius: var(--radius-md) !important;
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
  transition: all var(--transition) !important;
  border: none !important;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: var(--green-dark) !important;
  color: #fff !important;
}
.woocommerce .star-rating span::before { color: #BA7517; }
.woocommerce-notices-wrapper .woocommerce-message {
  border-top-color: var(--green) !important;
}

/* ===================================================
   AMELIA BOOKING OVERRIDES
=================================================== */
#amelia-app .am-button.-primary {
  background-color: var(--green) !important;
  border-color: var(--green) !important;
}
#amelia-app .am-button.-primary:hover {
  background-color: var(--green-dark) !important;
}
#amelia-app .am-step-header { font-family: var(--font-heading) !important; }

/* ===================================================
   UTILITY CLASSES
=================================================== */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
