/* 
  Eklesia Pro Premium Design System 
  Focus: Modern, Fast, Responsive, Mobile-First
*/

:root {
  /* Primary Palette (Cobalt and Amber/Gold) */
  --primary: 221 83% 53%; /* Cobalt Blue */
  --primary-foreground: 210 40% 98%;
  
  --secondary: 45 93% 47%; /* Champagne Gold */
  --secondary-foreground: 222 47% 11%;

  /* Base Light Theme */
  --background: 0 0% 100%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  --accent: 210 40% 96%;
  --accent-foreground: 222 47% 11%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 210 40% 98%;
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 221 83% 53%;
  --radius: 1rem;

  /* Premium Utility Colors */
  --success: 142 71% 45%;
  --warning: 38 92% 50%;
  --info: 199 89% 48%;

  /* Shadow & Glassmorphism Defaults */
  --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);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.2);
}

.dark {
  --background: 222 47% 11%;
  --foreground: 210 40% 98%;
  --card: 222 47% 12%;
  --card-foreground: 210 40% 98%;
  --popover: 222 47% 11%;
  --popover-foreground: 210 40% 98%;
  --muted: 217 33% 17%;
  --muted-foreground: 215 20% 65%;
  --accent: 217 33% 17%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 63% 31%;
  --destructive-foreground: 210 40% 98%;
  --border: 217 33% 17%;
  --input: 217 33% 17%;
  --ring: 224 76% 48%;
  --glass-bg: rgba(15, 23, 42, 0.7);
  --glass-border: rgba(30, 41, 59, 0.5);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  overflow-x: hidden;
  transition: background-color 0.3s ease;
  line-height: 1.5;
}

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes pulse-subtle {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-slide-up { animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

/* Layout Components */
.app-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: hsl(var(--background));
  box-shadow: var(--shadow-lg);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: 70px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid hsl(var(--border) / 0.5);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 1000;
  border-radius: 1.5rem 1.5rem 0 0;
}

.nav-item {
  color: hsl(var(--muted-foreground));
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 8px;
}

.nav-item.active {
  color: hsl(var(--primary));
  transform: translateY(-4px);
}

.nav-item i {
  font-size: 1.5rem;
  margin-bottom: 4px;
}

/* Dashboard Cards */
.card {
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:active {
  transform: scale(0.98);
}

/* Forms & Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  gap: 0.5rem;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.input-group {
  margin-bottom: 1rem;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: hsl(var(--muted-foreground));
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, ring 0.2s ease;
}

.input-field:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.1);
}

/* Feed / Mural Styling */
.post-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-header {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.post-image {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.post-actions {
  padding: 8px 12px;
  display: flex;
  gap: 16px;
}

/* Utility Badges */
.badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-admin { background: hsl(var(--primary) / 0.1); color: hsl(var(--primary)); }
.badge-leader { background: hsl(var(--warning) / 0.1); color: hsl(var(--warning)); }
.badge-member { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--muted));
  border-radius: 10px;
}

/* Specialized Grid for Ministries */
.ministry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ministry-card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  border: 1px solid hsl(var(--border));
  transition: all 0.2s ease;
}

.ministry-card:active { transform: scale(0.95); }

.ministry-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

/* Event Timeline Styles */
.event-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: white;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border-left: 4px solid hsl(var(--primary));
  box-shadow: var(--shadow-sm);
}

.event-date-box {
  text-align: center;
  min-width: 50px;
}

.event-day { font-size: 1.25rem; font-weight: 800; color: hsl(var(--primary)); }
.event-month { font-size: 0.7rem; text-transform: uppercase; font-weight: 600; color: hsl(var(--muted-foreground)); }

/* Prayer Bubble Styles */
.prayer-card {
  background: hsl(var(--card));
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid hsl(var(--border));
  position: relative;
}

.prayer-status {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 85px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 28px;
  background: hsl(var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 900;
  cursor: pointer;
}

/* WhatsApp Utility */
:root {
  --whatsapp: 142 70% 49%;
}

.btn-whatsapp {
  background-color: hsl(var(--whatsapp));
  color: white;
}

/* Enhanced Modal System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end; /* Mobile drawer style */
  justify-content: center;
  z-index: 3000;
}

@media (min-width: 500px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-content {
  background: hsl(var(--background));
  width: 100%;
  max-width: 500px;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}

@media (min-width: 500px) {
  .modal-content {
    border-radius: 24px;
    margin: 20px;
  }
}

/* Anniversary Section Styling */
.birthday-card {
  background: linear-gradient(135deg, hsl(var(--primary) / 0.1), hsl(var(--secondary) / 0.1));
  border: 1px dashed hsl(var(--primary) / 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.birthday-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}

/* Glass Tabs */
.glass-tabs {
  display: flex;
  background: hsl(var(--muted));
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.glass-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.glass-tab.active {
  background: white;
  color: hsl(var(--primary));
  box-shadow: var(--shadow-sm);
}

@media (max-width: 500px) {
  .app-container {
    box-shadow: none;
  }
}
