/*
 * Moment Hijrah - Main Stylesheet
 * Premium, Modern Event Ticketing System
 */

:root {
  /* Colors */
  --primary: #C49B30; /* Primary Gold */
  --primary-light: #D4AF37;
  --primary-dark: #A67C21;
  --secondary: #F5E6C8;
  --bg-light: #FAFAF7;
  --card-bg: #FFFFFF;
  --dark: #1A1A2E;
  --text-primary: #2D2D2D;
  --text-secondary: #6B7280;
  
  /* Status Colors */
  --status-pending: #f59e0b;
  --status-paid: #10b981;
  --status-rejected: #ef4444;
  --status-used: #3b82f6;

  /* Typography */
  --font-family: 'Poppins', sans-serif;
  
  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 50rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #1A1A2E 0%, #C49B30 100%);
  --gradient-secondary: linear-gradient(135deg, #D4AF37 0%, #F5E6C8 100%);
}

/* =========================================
   Base & Typography
   ========================================= */
body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: #f8fafc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  color: var(--text-primary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

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

/* =========================================
   Custom Scrollbar
   ========================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9; 
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1; 
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8; 
}

/* =========================================
   Navbar Styles
   ========================================= */
.navbar {
  transition: all 0.3s ease-in-out;
  padding: 1rem 0;
  z-index: 1030;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary) !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand i {
  color: var(--secondary);
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
  color: var(--primary);
  background-color: var(--bg-light);
}

/* Transparent to Solid on Scroll */
.navbar-transparent {
  background-color: transparent !important;
}
.navbar-transparent .navbar-brand {
  color: #fff !important;
}
.navbar-transparent .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}
.navbar-transparent .nav-link:hover {
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-scrolled {
  background-color: #ffffff !important;
  box-shadow: var(--shadow-md);
  padding: 0.75rem 0;
}
.navbar-scrolled .navbar-brand {
  color: var(--primary) !important;
}
.navbar-scrolled .nav-link {
  color: var(--text-primary) !important;
}
.navbar-scrolled .nav-link:hover {
  color: var(--primary) !important;
  background-color: var(--bg-light);
}

/* =========================================
   Buttons
   ========================================= */
.btn {
  border-radius: var(--radius-md);
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  transition: all 0.3s ease;
}

.btn-primary-custom {
  background: var(--gradient-primary);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(196, 155, 48, 0.2);
}

.btn-primary-custom:hover, .btn-primary-custom:focus {
  background: linear-gradient(135deg, #A67C21 0%, #1A1A2E 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 155, 48, 0.3);
}

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

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

/* =========================================
   Hero Section
   ========================================= */
.hero-section {
  background: var(--gradient-primary);
  padding: 160px 0 100px;
  position: relative;
  overflow: hidden;
  color: white;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../images/pattern.svg') center/cover;
  opacity: 0.1;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  font-weight: 300;
  opacity: 0.9;
  margin-bottom: 2.5rem;
}

.search-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  gap: 0.5rem;
}

.search-box input {
  border: none;
  box-shadow: none;
  padding: 1rem 1.5rem;
}

.search-box input:focus {
  outline: none;
  box-shadow: none;
}

.search-box .btn {
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
}

/* =========================================
   Event Cards
   ========================================= */
.event-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.event-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.event-img-wrapper {
  position: relative;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
}

.event-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.event-card:hover .event-img {
  transform: scale(1.05);
}

.event-category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-dark);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.event-price-badge {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: var(--secondary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
}

.event-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.event-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-meta i {
  color: var(--primary);
  width: 16px;
}

.event-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================================
   Badges
   ========================================= */
.badge-custom {
  padding: 0.35em 0.65em;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.badge-pending {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--status-pending);
}
.badge-paid {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--status-paid);
}
.badge-rejected {
  background-color: rgba(239, 68, 68, 0.1);
  color: var(--status-rejected);
}
.badge-used {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--status-used);
}

/* =========================================
   Section Headings
   ========================================= */
.section-heading {
  position: relative;
  display: inline-block;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
}
.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: var(--radius-pill);
}

/* =========================================
   Footer
   ========================================= */
.site-footer {
  background-color: var(--dark);
  color: #fff;
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-heading {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--primary-light);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: all 0.3s;
}

.social-links a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* =========================================
   Auth Pages
   ========================================= */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  background-color: var(--bg-light);
}

.auth-side {
  flex: 1;
  background: var(--gradient-primary);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

@media (min-width: 992px) {
  .auth-side {
    display: flex;
  }
}

.auth-side::after {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  background: url('../images/pattern.svg') center/cover;
  opacity: 0.05;
  animation: rotate 60s linear infinite;
}

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

.auth-form-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
  max-width: 100%;
}

@media (min-width: 992px) {
  .auth-form-wrapper {
    max-width: 500px;
    margin: 0 auto;
  }
}

.auth-card {
  background: white;
  padding: 3rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

/* =========================================
   Admin Layout
   ========================================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  background: var(--dark);
  color: white;
  transition: all 0.3s ease;
  z-index: 1040;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-menu {
  padding: 1rem 0;
  flex: 1;
  overflow-y: auto;
}

.sidebar-item {
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #cbd5e1;
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-item:hover, .sidebar-item.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-left: 4px solid var(--primary-light);
}

.admin-content {
  flex: 1;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-topbar {
  background: white;
  height: 70px;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  z-index: 1030;
}

.admin-main {
  padding: 2rem;
  flex: 1;
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s;
}

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

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.stat-icon.primary { background: rgba(196, 155, 48, 0.1); color: var(--primary); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.stat-icon.info { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }

.stat-details h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.stat-details p {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.875rem;
}

/* =========================================
   Tables & Forms
   ========================================= */
.table-custom {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-custom th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.table-custom td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  color: var(--text-secondary);
}

/* Floating Labels */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--primary);
}
.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.25);
}

/* =========================================
   Animations & Transitions
   ========================================= */
.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.slide-up {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.8s ease forwards;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }

@keyframes fadeIn {
  to { opacity: 1; }
}

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

.float-effect {
  animation: float 6s ease-in-out infinite;
}

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

/* =========================================
   Loading Overlay
   ========================================= */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.5s;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(196, 155, 48, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* =========================================
   Responsive Adjustments & Comprehensive Mobile CSS
   ========================================= */

/* Prevent iOS Safari 16px auto-zoom on input focus */
@media screen and (max-width: 767.98px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Tablet & Mobile Navigation & Layout */
@media (max-width: 991.98px) {
  .hero-section {
    padding: 100px 0 40px;
    text-align: center;
  }
  .hero-title {
    font-size: 2.25rem;
    line-height: 1.25;
  }
  .hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }
  
  /* Navbar Drawer for Mobile */
  .navbar-collapse {
    background: #ffffff;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    margin-top: 0.75rem;
    border: 1px solid rgba(196, 155, 48, 0.15);
    animation: fadeInDown 0.3s ease forwards;
  }
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.25rem;
  }
  .navbar-nav .nav-link:hover, .navbar-nav .nav-link.active {
    background-color: #f8fafc;
    color: var(--primary) !important;
  }

  /* Admin Mobile Sidebar */
  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -270px;
    width: 270px;
    height: 100vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.3);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1045;
  }
  .admin-sidebar.show {
    left: 0;
  }

  /* Admin Content adjustment on mobile */
  .admin-topbar {
    padding: 0 1rem;
  }
  .admin-main {
    padding: 1.25rem 1rem;
  }
}

/* Mobile Screens (< 768px) */
@media (max-width: 767.98px) {
  .hero-section {
    padding: 70px 0 30px;
  }
  .hero-title {
    font-size: 1.75rem;
    line-height: 1.3;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }

  /* Mobile Search Box */
  .search-box {
    flex-direction: column;
    padding: 0.875rem;
    border-radius: var(--radius-xl);
    gap: 0.75rem;
  }
  .search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    background-color: #f8fafc;
  }
  .search-box .btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-weight: 600;
    font-size: 1rem;
  }

  /* Mobile Event Cards */
  .event-card {
    margin-bottom: 0.5rem;
    border-radius: var(--radius-xl);
  }
  .event-img-wrapper {
    padding-top: 52%;
  }
  .event-card-body {
    padding: 1.25rem;
  }
  .event-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  .event-meta {
    font-size: 0.825rem;
  }
  .event-footer {
    flex-direction: row;
    gap: 0.5rem;
  }

  /* Section Headings on Mobile */
  .section-heading {
    margin-bottom: 2rem;
    font-size: 1.4rem;
  }

  /* Mobile Tables & Cards */
  .table-responsive {
    border: 0;
    border-radius: var(--radius-lg);
    -webkit-overflow-scrolling: touch;
  }
  .table-custom th, .table-custom td {
    padding: 0.75rem 0.875rem;
    font-size: 0.875rem;
    white-space: nowrap;
  }

  /* Stepper on Mobile */
  .checkout-stepper, .d-flex.justify-content-center.mb-5 {
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }

  /* Floating WhatsApp Mobile Position */
  .floating-wa {
    width: 52px;
    height: 52px;
    bottom: 20px;
    right: 20px;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  /* Auth Screens on Mobile */
  .auth-form-container {
    padding: 1.5rem 1rem !important;
  }
  .auth-form-wrapper {
    max-width: 100%;
  }

  /* Stat Cards 2x2 Grid on Mobile */
  .stat-card {
    padding: 1rem;
    gap: 1rem;
  }
  .stat-icon {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }
  .stat-details h3 {
    font-size: 1.35rem;
  }

  /* Footer on Mobile */
  .site-footer {
    padding: 3rem 0 1.5rem;
    text-align: center;
  }
  .social-links {
    justify-content: center;
    margin-top: 1rem;
  }
}

/* Extra Small Screens (< 576px) */
@media (max-width: 575.98px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .hero-title {
    font-size: 1.5rem;
  }
  .btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
  }
  .card-body {
    padding: 1rem !important;
  }
}

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