/* Global Variable Palette & Styling Setup */
:root {
  --font-display: 'Heebo', 'Assistant', sans-serif;
  --font-body: 'Assistant', sans-serif;
  --font-serif: 'Playfair Display', serif;

  /* Color Palette - Premium deep midnight blue, beautiful gold and emerald accent */
  --color-bg: #090e1a;
  --color-surface: #12192c;
  --color-surface-hover: #19233c;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-active: #d4af37;
  
  --color-primary: #d4af37; /* Metallic premium gold */
  --color-primary-hover: #f3cf59;
  --color-secondary: #10b981; /* Fresh emerald green */
  --color-secondary-hover: #34d399;
  
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.5), 0 12px 15px -8px rgba(0, 0, 0, 0.4);
  
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
}

/* RTL Specific adjustments dynamic support */
[dir="rtl"] {
  --font-display: 'Heebo', sans-serif;
  --font-body: 'Assistant', sans-serif;
}

/* Base resets & layouts */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  scroll-behavior: smooth;
  height: 100%;
}

/* Beautiful Ambient Gradient Orbs in Background */
body::before {
  content: '';
  position: absolute;
  top: -15%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.08) 0%, rgba(9, 14, 26, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: -5%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(9, 14, 26, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

/* Header Styling */
.app-header {
  border-bottom: 1px solid var(--color-border);
  background-color: rgba(18, 25, 44, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-symbol {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.75rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

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

.main-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.badge-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--color-secondary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  font-weight: 600;
}

/* Main Container */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  min-height: calc(100vh - 180px);
}

/* Hero Section & Split Layout */
.hero-section {
  margin-bottom: 4rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 4rem;
  align-items: center;
}

.hero-info {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tagline {
  color: var(--color-primary);
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
}

.hero-description {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  max-width: 520px;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.stat-card {
  background-color: rgba(18, 25, 44, 0.4);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  border-radius: var(--border-radius-md);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(214, 175, 87, 0.2);
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.stat-lbl {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* Donation Hub Container */
.widget-container {
  position: relative;
}

.widget-container::before {
  content: '';
  position: absolute;
  top: -15px;
  right: -15px;
  bottom: -15px;
  left: -15px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(16, 185, 129, 0.15) 100%);
  border-radius: 30px;
  z-index: -1;
  filter: blur(10px);
}

.giving-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
}

.giving-box-header {
  margin-bottom: 1.5rem;
}

.giving-box-header h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.giving-box-header p {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

/* Campaign Selector (Tabs) */
.campaign-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background-color: rgba(9, 14, 26, 0.5);
  padding: 4px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1.5rem;
  border: 1px solid var(--color-border);
}

.camp-btn {
  background: transparent;
  border: none;
  color: var(--color-text-secondary);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.75rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.camp-btn:hover {
  color: var(--color-text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.camp-btn.active {
  background-color: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(212, 175, 55, 0.15);
}

.camp-icon {
  font-size: 1.25rem;
}

/* Progress bar dynamic styles */
.progress-section {
  margin-bottom: 1.75rem;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

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

.progress-val {
  color: var(--color-primary);
  font-weight: 700;
}

.progress-bar-bg {
  height: 8px;
  background-color: rgba(9, 14, 26, 0.6);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 10px;
  width: 0;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bottom {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.raised-amt {
  color: var(--color-text-primary);
  font-weight: 600;
}

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

/* Button & input Grid */
.amount-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.amt-btn {
  background-color: rgba(9, 14, 26, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 0.75rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.amt-btn:hover {
  background-color: var(--color-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.amt-btn.active {
  background-color: rgba(212, 175, 55, 0.08);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.1);
}

.amt-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.amt-hebrew {
  font-size: 0.7rem;
  color: var(--color-text-secondary);
}

.amt-btn.active .amt-hebrew {
  color: var(--color-primary);
}

/* Custom Input Field */
.custom-amount-wrapper {
  margin-bottom: 1.75rem;
}

.custom-amount-wrapper label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.input-with-symbol {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 1rem;
  color: var(--color-text-secondary);
  font-weight: 600;
}

[dir="rtl"] .currency-symbol {
  right: 1rem;
  left: auto;
}

.input-with-symbol input {
  width: 100%;
  background-color: rgba(9, 14, 26, 0.4);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-sm);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 0.75rem 1rem 0.75rem 2.25rem;
  transition: all 0.2s ease;
}

[dir="rtl"] .input-with-symbol input {
  padding: 0.75rem 2.25rem 0.75rem 1rem;
}

.input-with-symbol input:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: rgba(9, 14, 26, 0.6);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.1);
}

/* Button UI styling */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  border: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #0d121f;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.25);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
}

/* Button Shimmer / Glow Effect */
.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg);
  pointer-events: none;
}

.btn-primary:hover .btn-shine {
  animation: shine 0.75s ease-in-out;
}

@keyframes shine {
  100% {
    left: 125%;
  }
}

.widget-footer {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  text-align: center;
}

/* Success Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--border-radius-lg);
  padding: 3rem 2.5rem;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-animation {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.checkmark-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkmark {
  width: 40px;
  height: 20px;
  border-left: 3px solid var(--color-secondary);
  border-bottom: 3px solid var(--color-secondary);
  transform: rotate(-45deg) translate(5px, -5px);
}

.modal-card h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.modal-card p {
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.modal-subtext {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem !important;
}

/* Footer style */
.app-footer {
  text-align: center;
  padding: 2.5rem 2rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

/* Simple keyframe animations */
.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
  animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive media queries */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .hero-title {
    font-size: 2.75rem;
  }
  
  .app-main {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 500px) {
  .hero-title {
    font-size: 2.25rem;
  }
  
  .campaign-selector {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  
  .camp-btn {
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .amount-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
