/* css/main.css */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  /* Direction setup for Arabic */
  direction: rtl;
  overscroll-behavior-y: none; /* Prevents pull-to-refresh bounce in PWA */
}

/* Typography Baseline */
p, span, a, input, button, select, textarea {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
}

h1 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
}

h3 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-semibold);
}

h4 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
}

/* Helper Class Utilities */
.text-xs { font-size: var(--font-size-xs) !important; }
.text-sm { font-size: var(--font-size-sm) !important; }
.text-base { font-size: var(--font-size-base) !important; }
.text-md { font-size: var(--font-size-md) !important; }
.text-lg { font-size: var(--font-size-lg) !important; }
.text-xl { font-size: var(--font-size-xl) !important; }
.text-2xl { font-size: var(--font-size-2xl) !important; }

.font-light { font-weight: var(--font-weight-light) !important; }
.font-regular { font-weight: var(--font-weight-regular) !important; }
.font-medium { font-weight: var(--font-weight-medium) !important; }
.font-semibold { font-weight: var(--font-weight-semibold) !important; }
.font-bold { font-weight: var(--font-weight-bold) !important; }

/* Base utility classes */
a {
  text-decoration: none;
  color: inherit;
}

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

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

/* Tab Bar */
.bottom-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
  background-color: var(--bg-card);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: var(--safe-area-bottom);
  z-index: 1000;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.3s ease;
  width: 60px;
}

.tab-item i {
  font-size: 1.5rem;
  margin-bottom: 4px;
  transition: transform 0.3s ease;
}

.tab-item.active {
  color: var(--primary-color);
}

.tab-item.active i {
  transform: translateY(-2px);
}

/* Floating Action Button / Switcher */
.floating-switcher {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom) + 8px);
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(229, 231, 235, 0.5);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  z-index: 999;
  font-weight: 600;
  font-size: 0.85rem;
}

.switcher-btn {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
  text-decoration: none;
}

.switcher-btn.active {
  color: var(--primary-color);
  font-weight: 700;
}

.switcher-btn:hover {
  color: var(--text-primary);
}

.switcher-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-color);
}

/* Global Search Bar Styles */
.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  gap: 10px;
  color: var(--text-secondary);
}

.search-bar svg, .search-bar i {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.85rem;
  width: 100%;
  color: var(--text-primary);
  outline: none;
}

/* Glass dropdown menu style */
.glass-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  background-color: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  width: 170px;
  padding: 6px;
}

body.dark-mode .glass-dropdown {
  background-color: rgba(30, 41, 59, 0.8) !important;
  border: 1px solid rgba(71, 85, 105, 0.8) !important;
}

.dropdown-item {
  background: transparent;
  border: none;
  text-align: right;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  display: block;
}

.dropdown-item:hover {
  background-color: var(--bg-subtle);
  color: var(--primary-color);
}

.dropdown-item.active {
  background-color: rgba(0, 188, 212, 0.08);
  color: var(--primary-color);
  font-weight: 700;
}
