/* ============================================
   نادي بهجة - BahgaClub Design System
   ✨ Bright, Cheerful & Joyful Theme
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors - Bright Bahga Theme */
  --bg-primary: #FAFCFF;
  --bg-secondary: #F0F5FF;
  --bg-tertiary: #E8F0FE;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F7FAFF;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-glass-strong: rgba(255, 255, 255, 0.95);
  --bg-input: #FFFFFF;

  /* Brand Colors - Bahga Orange + Sky Blue */
  --primary: #F7941D;
  --primary-light: #FFAD42;
  --primary-dark: #E07E0E;
  --primary-dark-text: #B25900;
  --primary-glow: rgba(247, 148, 29, 0.25);
  --primary-bg: rgba(247, 148, 29, 0.08);

  --accent: #4AADDB;
  --accent-light: #6DC5ED;
  --accent-dark: #3898C7;
  --accent-dark-text: #1D6E96;
  --accent-glow: rgba(74, 173, 219, 0.25);
  --accent-bg: rgba(74, 173, 219, 0.08);

  --secondary: #FF6B9D;
  --secondary-light: #FF8FB7;
  --secondary-bg: rgba(255, 107, 157, 0.08);

  --tertiary: #7C5CFC;
  --tertiary-light: #9B82FD;

  /* Semantic Colors */
  --success: #2ECC71;
  --success-light: #58D68D;
  --success-bg: rgba(46, 204, 113, 0.1);

  --warning: #F39C12;
  --warning-light: #F5B041;
  --warning-bg: rgba(243, 156, 18, 0.1);

  --danger: #E74C3C;
  --danger-light: #EC7063;
  --danger-bg: rgba(231, 76, 60, 0.1);

  --info: #3498DB;
  --info-light: #5DADE2;
  --info-bg: rgba(52, 152, 219, 0.1);

  /* Text Colors */
  --text-primary: #2C3E50;
  --text-secondary: #5D6D7E;
  --text-tertiary: #85929E;
  --text-muted: #AEB6BF;
  --text-on-primary: #1E1204;
  --text-on-accent: #0B2230;

  /* Border */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-default: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.18);
  --border-focus: var(--primary);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows - Soft & Warm */
  --shadow-sm: 0 2px 8px rgba(247, 148, 29, 0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(247, 148, 29, 0.1), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(247, 148, 29, 0.12), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-card: 0 2px 12px rgba(74, 173, 219, 0.08), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-card-hover: 0 8px 28px rgba(247, 148, 29, 0.15), 0 4px 12px rgba(74, 173, 219, 0.1);
  --shadow-glow-primary: 0 0 24px var(--primary-glow);
  --shadow-glow-accent: 0 0 24px var(--accent-glow);

  /* Typography */
  --font-family: 'Segoe UI', Tahoma, 'Arial', 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: 2rem;
  --font-size-4xl: 2.5rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  /* Layout */
  --sidebar-width: 280px;
  --header-height: 64px;
  --max-content-width: 1200px;
}

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

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

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Joyful background with subtle decorative shapes */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(247, 148, 29, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(74, 173, 219, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 85%, rgba(46, 204, 113, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 75%, rgba(255, 107, 157, 0.04) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

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

a:hover {
  color: var(--primary-dark);
}

img,
video {
  max-width: 100%;
  display: block;
}

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

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: none;
}

ul,
ol {
  list-style: none;
}

/* ---------- Scrollbar (Cheerful) ---------- */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-light), var(--accent));
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
}

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

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

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

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

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

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

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

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

/* ---------- Layout ---------- */
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 2px 12px rgba(74, 173, 219, 0.08);
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
}

.app-header .logo-icon {
  font-size: 1.6rem;
}

.app-main {
  flex: 1;
  padding: var(--space-xl);
  max-width: var(--max-content-width);
  margin: 0 auto;
  width: 100%;
}

.app-sidebar {
  position: fixed;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  padding: var(--space-lg);
  overflow-y: auto;
  z-index: var(--z-sticky);
  transform: translateX(0);
  transition: transform var(--transition-base);
}

.app-sidebar.collapsed {
  transform: translateX(100%);
}

.with-sidebar .app-main {
  margin-right: var(--sidebar-width);
}

/* Page sections */
.page-header {
  margin-bottom: var(--space-2xl);
}

.page-header h1 {
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
}

.section {
  margin-bottom: var(--space-2xl);
}

.section-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--primary-dark);
}

/* Grid layouts */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.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-auto {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Flex utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-xs {
  gap: var(--space-xs);
}

.gap-sm {
  gap: var(--space-sm);
}

.gap-md {
  gap: var(--space-md);
}

.gap-lg {
  gap: var(--space-lg);
}

.gap-xl {
  gap: var(--space-xl);
}

/* Spacing utilities */
.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.p-sm {
  padding: var(--space-sm);
}

.p-md {
  padding: var(--space-md);
}

.p-lg {
  padding: var(--space-lg);
}

.p-xl {
  padding: var(--space-xl);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-sidebar {
    transform: translateX(100%);
  }

  .with-sidebar .app-main {
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.5rem;
    --font-size-2xl: 1.25rem;
  }

  .app-main {
    padding: var(--space-md);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .hide-mobile {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 0 var(--space-md);
  }
}

/* ---------- Selection ---------- */
::selection {
  background: var(--primary);
  color: var(--text-on-primary);
}

/* ---------- Focus Visible ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}