@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #7C3AED;
  --accent: #06B6D4;
  --success: #10B981;
  --bg: #F8FAFC;
  --text: #0F172A;
  --muted: #64748B;
  --white: #FFFFFF;
  --border: #E2E8F0;
  --light: #F1F5F9;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 15px 35px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 25px 50px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;
}

/* Brand Custom Classes */
.bg-brand { background-color: var(--primary) !important; color: #fff !important; }
.bg-brand-gradient { background: linear-gradient(135deg, var(--primary), var(--secondary)) !important; color: #fff !important; }
.text-brand { color: var(--primary) !important; }
.btn-brand { background-color: var(--primary); color: #fff; border: 1px solid var(--primary); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-brand:hover { background-color: var(--primary-hover); color: #fff; border-color: var(--primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-outline-brand { color: var(--primary); border: 1px solid var(--primary); background: transparent; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.btn-outline-brand:hover { background-color: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* Glassmorphism Utilities */
.glass {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}
.glass-dark {
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Smooth Transitions */
.hover-float {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.hover-float:hover {
  transform: translateY(-5px) !important;
  box-shadow: var(--shadow-md) !important;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Cairo', system-ui, -apple-system, Tahoma, sans-serif;
  letter-spacing: -0.01em;
}

.text-primary-custom {
  color: var(--primary);
}

.text-accent {
  color: var(--accent);
}

.text-muted-custom {
  color: var(--muted);
}

.bg-primary-custom {
  background: var(--primary);
  color: #fff;
}

.bg-primary-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.bg-accent-soft {
  background: rgba(6, 182, 212, 0.08);
}

.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  border: none;
  padding: 10px 24px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary-custom:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary-custom {
  border: 2px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius);
  background: transparent;
  padding: 8px 20px;
  font-weight: 600;
  transition: all 0.2s;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: var(--light);
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-hover {
  transition: all 0.25s;
}

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

.hero-section {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.search-box {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  color: #fff;
  padding: 14px 18px;
}

.search-box::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.search-box:focus {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
  box-shadow: none;
}

.cat-tile {
  display: block;
  text-align: center;
  padding: 22px 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  height: 100%;
  transition: all 0.25s;
}

.cat-tile:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cat-tile i {
  font-size: 26px;
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
}

.avatar {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-lg {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-xl {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--white);
  box-shadow: var(--shadow-md);
}

.service-card,
.request-card {
  transition: all 0.25s;
  height: 100%;
}

.service-card:hover,
.request-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.service-card .badge,
.request-card .badge {
  font-weight: 500;
}

.chat-box {
  height: 55vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px;
  scroll-behavior: smooth;
}

.bubble {
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 18px;
  margin-bottom: 10px;
  line-height: 1.5;
  word-wrap: break-word;
}

.bubble.me {
  background: var(--primary);
  color: #fff;
  border-bottom-left-radius: 4px;
  margin-inline-start: auto;
}

.bubble.them {
  background: var(--white);
  border: 1px solid var(--border);
  border-bottom-right-radius: 4px;
}

.bubble .time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
}

.bubble.me .time {
  text-align: left;
}

.bubble .read-status {
  font-size: 10px;
  opacity: 0.6;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.skeleton {
  background: linear-gradient(90deg, var(--light) 25%, #e8ecf1 50%, var(--light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

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

  100% {
    background-position: -200% 0;
  }
}

.notif-dropdown {
  width: 340px;
  max-height: 380px;
  overflow-y: auto;
  padding: 0;
}

.notif-dropdown .notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.notif-dropdown .notif-item:hover {
  background: var(--light);
}

.notif-dropdown .notif-item.unread {
  background: rgba(79, 70, 229, 0.04);
  border-inline-start: 3px solid var(--primary);
}

.notif-dropdown .notif-title {
  font-size: 13px;
  font-weight: 600;
}

.notif-dropdown .notif-time {
  font-size: 11px;
  color: var(--muted);
}

.bottom-nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 12px;
  z-index: 1030;
}

.bottom-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  text-align: center;
  flex: 1;
  transition: color 0.2s;
}

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

.bottom-nav a i {
  display: block;
  font-size: 22px;
  margin-bottom: 4px;
}

.bottom-nav a.add i {
  color: var(--primary);
}

.bottom-nav a .badge {
  position: absolute;
  top: 0;
  inset-inline-end: 50%;
  transform: translateX(50%);
  font-size: 9px;
}

.profile-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 40px 0 30px;
  position: relative;
}

.profile-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.progress-bar-custom {
  height: 8px;
  border-radius: 99px;
  background: var(--light);
  overflow: hidden;
}

.progress-bar-custom .progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.5s;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 13px;
}

.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  font-size: 20px;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.star-rating {
  color: #F59E0B;
}

.conv-list {
  max-height: 70vh;
  overflow-y: auto;
}

.conv-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius);
  transition: background 0.15s;
}

.conv-item:hover {
  background: var(--light);
}

.conv-item.active {
  background: rgba(79, 70, 229, 0.06);
  border-inline-start: 3px solid var(--primary);
}

.conv-item .last-msg {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.conv-item .time-ago {
  font-size: 10px;
  color: var(--muted);
}

.navbar {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95) !important;
}

.navbar-brand {
  font-weight: 800;
  font-size: 20px;
}

.filter-offcanvas .btn-close {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
}

@media (max-width: 991.98px) {
  .hero-section {
    padding: 40px 0 60px;
  }

  .hero-section h1 {
    font-size: 24px;
  }

  .profile-header {
    padding: 30px 0 20px;
  }
}

@media (min-width: 992px) {
  .d-lg-conv-list {
    display: block !important;
  }

  .d-lg-chat {
    display: block !important;
  }

  .d-mobile-back {
    display: none;
  }
}

.form-control,
.form-select {
  border-radius: var(--radius);
  border-color: var(--border);
  padding: 10px 14px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.pagination .page-link {
  border: none;
  border-radius: var(--radius);
  margin: 0 2px;
  color: var(--text);
}

.pagination .page-item.active .page-link {
  background: var(--primary);
}

.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-nav a {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}

.tab-nav a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-nav a:hover {
  color: var(--primary);
}

/* CTA button styles */
.btn-cta-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.btn-cta-primary:hover {
  opacity: 0.9;
}

.btn-cta-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
}

.smart-search {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  transition: border-color 0.2s;
  cursor: pointer;
  max-width: 500px;
}

/* CTA button size */
.btn-cta-primary,
.btn-cta-secondary {
  font-size: 1.1rem;
  padding: 0.75rem 1.5rem;
}

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

/* Bottom navigation styles */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bottom-nav a .fa-solid {
  font-size: 1.2rem;
}

.bottom-nav a span {
  display: block;
  font-size: 0.75rem;
}

html[lang="ar"] .bottom-nav {
  direction: rtl;
}