/*
Theme Name: KAHRMAA
Theme URI: https://kahrmaa.com
Author: KAHRMAA Team
Author URI: https://kahrmaa.com
Description: ثيم احترافي لشركة كهرماء لكشف تسربات المياه وعزل الأسطح بالمنطقة الشرقية
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kahrmaa
Tags: rtl-language, arabic, business, custom-colors, custom-menu, custom-logo, featured-images, footer-widgets, translation-ready
*/

/* ========================================
   CSS Variables
======================================== */
:root {
  --primary: #005B96;
  --primary-dark: #004a7a;
  --primary-light: #0072bb;
  --secondary: #FF7A00;
  --secondary-dark: #e06900;
  --secondary-light: #ff9533;
  --white: #FFFFFF;
  --dark: #222222;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --text-primary: #222222;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.15);
  --shadow-xl: 0 16px 60px rgba(0,0,0,0.18);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
  --radius-full: 9999px;
  --transition: all 0.3s ease;
  --transition-fast: all 0.15s ease;
  --transition-slow: all 0.5s ease;
  --font-primary: 'Cairo', 'Tajawal', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;
  --header-height: 80px;
  --container-max: 1280px;
}

[data-theme="dark"] {
  --white: #1a1a2e;
  --dark: #e8e8e8;
  --gray-100: #16213e;
  --gray-200: #1e2a4a;
  --gray-300: #2a3a5a;
  --gray-400: #3a4a6a;
  --gray-500: #5a6a8a;
  --gray-600: #8a9aaa;
  --gray-700: #aab0bc;
  --gray-800: #c8ccd4;
  --gray-900: #e0e2e8;
  --text-primary: #e8e8e8;
  --text-secondary: #aaaaaa;
  --text-muted: #777777;
  --border-color: #2a3a5a;
}

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

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

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--white);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden; /* منع التمرير الأفقي */
}

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

a:hover { color: var(--secondary); }

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

ul, ol { list-style: none; }

button, input, textarea, select {
  font-family: var(--font-primary);
  font-size: inherit;
  outline: none;
  border: none;
}

button { cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--dark);
}

p { margin-bottom: 1rem; }

/* ========================================
   Utility Classes
======================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.section-padding { padding: 80px 0; }
.section-padding-sm { padding: 50px 0; }
.section-padding-lg { padding: 120px 0; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-white { color: var(--white); }
.text-muted { color: var(--text-muted); }

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-white { background-color: var(--white); }
.bg-light { background-color: var(--gray-100); }
.bg-dark { background-color: var(--dark); }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

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

.overflow-hidden { overflow: hidden; }
.relative { position: relative; }
.absolute { position: absolute; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========================================
   Section Headers
======================================== */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-label {
  display: inline-block;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--secondary);
  background: rgba(255, 122, 0, 0.1);
  padding: 6px 20px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-title span { color: var(--primary); }

.section-subtitle {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.section-divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  margin: 20px auto;
  border-radius: var(--radius-full);
}

/* ========================================
   Buttons
======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: var(--font-size-base);
  font-weight: 700;
  font-family: var(--font-primary);
  border-radius: var(--radius-full);
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::after { width: 300px; height: 300px; }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 91, 150, 0.4);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--white);
  border-color: var(--secondary);
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  border-color: var(--secondary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 122, 0, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline-white:hover {
  background: var(--white);
  color: var(--primary);
}

.btn-whatsapp {
  background: #25D366;
  color: var(--white);
  border-color: #25D366;
}

.btn-whatsapp:hover {
  background: #1da851;
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.btn-lg { padding: 18px 40px; font-size: var(--font-size-lg); }
.btn-sm { padding: 10px 20px; font-size: var(--font-size-sm); }
.btn-xl { padding: 20px 48px; font-size: var(--font-size-xl); }

/* ========================================
   Cards
======================================== */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

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

/* ========================================
   Grid System
======================================== */
.grid { display: grid; gap: 30px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

/* ========================================
   Forms
======================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--white);
  transition: var(--transition-fast);
  direction: rtl;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 91, 150, 0.1);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

select.form-control { cursor: pointer; }

/* ========================================
   Badges & Labels
======================================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
}

.badge-primary { background: rgba(0,91,150,0.1); color: var(--primary); }
.badge-secondary { background: rgba(255,122,0,0.1); color: var(--secondary); }
.badge-success { background: rgba(40,167,69,0.1); color: #28a745; }

/* ========================================
   Animations
======================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

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

@keyframes wave {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.6s ease forwards; }
.animate-fadeInRight { animation: fadeInRight 0.6s ease forwards; }
.animate-fadeInLeft { animation: fadeInLeft 0.6s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Pagination
======================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 50px;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition-fast);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.pagination a:hover, .pagination .current {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ========================================
   Breadcrumb
======================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: 30px;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb-sep { color: var(--text-muted); }

/* ========================================
   Alert / Notice
======================================== */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-weight: 500;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }

/* ========================================
   Page Hero
======================================== */
.page-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 100px 0 60px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--white);
  margin-bottom: 16px;
  position: relative;
}

.page-hero .breadcrumb {
  justify-content: center;
  color: rgba(255,255,255,0.8);
  position: relative;
}

.page-hero .breadcrumb a { color: rgba(255,255,255,0.9); }

/* ========================================
   Sidebar
======================================== */
.sidebar-widget {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.sidebar-widget-title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--primary);
  position: relative;
}

.widget ul li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.widget ul li:last-child { border-bottom: none; }

.widget ul li a {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget ul li a:hover { color: var(--primary); }

/* ========================================
   WordPress Core Styles
======================================== */
.alignleft { float: right; margin: 0 0 20px 20px; }
.alignright { float: left; margin: 0 20px 20px 0; }
.aligncenter { display: block; margin: 0 auto 20px; }
.alignwide { max-width: 1200px; }
.alignfull { max-width: 100%; }

.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: var(--font-size-sm); color: var(--text-muted); text-align: center; }

.screen-reader-text { position: absolute; left: -9999px; }

img.wp-post-image { border-radius: var(--radius-md); }

/* Comment styles */
.comment-list { margin: 0; }
.comment { padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.comment-author { font-weight: 700; }
.comment-meta { font-size: var(--font-size-sm); color: var(--text-muted); }
