/* 
  Eklesia Pro - Sophisticated Light Design System
  Style: Modern, Clean, Professional
  Colors: Pure Whites, Soft Beige, Muted Gold
*/

:root {
  /* Core Palette (Clean & Gold) */
  --primary: 43 70% 45%; /* Sophisticated Gold */
  --primary-glow: 43 70% 45% / 0.15;
  --primary-foreground: 0 0% 100%;
  
  --secondary: 240 5% 96%; /* Ultra Light Gray */
  --secondary-foreground: 240 10% 10%;

  /* Light Theme Base */
  --background: 0 0% 100%;
  --foreground: 240 10% 10%;
  
  --card: 0 0% 100%;
  --card-foreground: 240 10% 10%;
  --card-border: 240 5% 90%;
  
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 10%;
  
  --muted: 240 5% 96%;
  --muted-foreground: 240 5% 45%;
  
  --accent: 43 70% 45% / 0.05;
  --accent-foreground: 43 70% 45%;
  
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 98%;
  
  --border: 240 5% 92%;
  --input: 240 5% 96%;
  --ring: 43 70% 45%;
  --radius: 1rem;

  /* Premium Effects */
  --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
  --shadow-gold: 0 15px 35px -5px rgba(184, 134, 11, 0.25);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
  --neu-light: rgba(255, 255, 255, 0.9);
  --neu-dark: rgba(0, 0, 0, 0.05);
}

/* --- Global Modern Styling --- */
@font-face {
  font-family: 'Outfit';
  src: url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;800&display=swap');
}

@font-face {
  font-family: 'Inter';
  src: url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .premium-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* --- Layout Elements --- */

.app-container {
  max-width: 500px;
  margin: 0 auto;
  min-height: 100vh;
  background: hsl(var(--background));
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 50px rgba(0,0,0,0.02);
}

.premium-header {
  height: 70px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: 75px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  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;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.03);
}

.nav-item {
  color: hsl(var(--muted-foreground));
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 10px;
}

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

/* --- Hero Section --- */

.hero-section {
  padding: 60px 24px 80px;
  background: white;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.flame-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 50% 120%, rgba(255, 165, 0, 0.4), transparent 70%),
    radial-gradient(circle at 20% 110%, rgba(255, 69, 0, 0.2), transparent 60%),
    radial-gradient(circle at 80% 110%, rgba(255, 215, 0, 0.3), transparent 60%);
  filter: blur(30px);
  z-index: 0;
  animation: flamePulse 6s infinite alternate ease-in-out;
}

@keyframes flamePulse {
  from { transform: scale(1); opacity: 0.6; }
  to { transform: scale(1.1) translateY(-10px); opacity: 0.9; }
}

/* --- Cards Grid --- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 0 24px 100px;
  margin-top: -40px; /* Overlap with hero slightly */
}

@media (max-width: 450px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

.premium-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,0,0,0.03);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.12);
}

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

.glass-pill {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  padding: 6px 14px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.neu-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--glass-bg);
  box-shadow: 5px 5px 15px var(--neu-dark), -5px -5px 15px var(--neu-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.neu-circle:active {
  box-shadow: inset 3px 3px 10px var(--neu-dark), inset -3px -3px 10px var(--neu-light);
  transform: scale(0.95);
}

.glossy-icon-large {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -5px hsl(var(--primary) / 0.4);
  color: white;
}

/* The subtle flame corner decoration */
.premium-card::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: -10px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at center, rgba(212, 175, 55, 0.1), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}

.card-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 8px;
}

.card-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a0a0a0;
  text-transform: none;
}

/* --- Glass App Grid (New Layout) --- */
.glass-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 24px 100px;
}

@media (max-width: 360px) {
  .glass-grid {
    gap: 12px;
    padding: 20px 16px 100px;
  }
}

.glossy-box {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s ease, filter 0.15s ease;
  box-shadow: 
    0 6px 16px rgba(0,0,0,0.4), 
    inset 0 2px 4px rgba(255,255,255,0.6), 
    inset 0 -6px 10px rgba(0,0,0,0.5), 
    inset 0 0 0 1px rgba(255,255,255,0.2);
  cursor: pointer;
}

.glossy-box:active {
  transform: scale(0.92);
  filter: brightness(0.9);
}

.glossy-box::after {
  content: '';
  position: absolute;
  top: 2%; left: 5%; right: 5%;
  height: 40%;
  background: linear-gradient(180deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.02) 100%);
  border-radius: 14px 14px 50% 50%;
  pointer-events: none;
}

.glossy-icon {
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  margin-bottom: 8px;
}

.glossy-text {
  z-index: 1;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  line-height: 1.1;
  padding: 0 2px;
}

/* Unified Glossy Box Background */
.glossy-unified { 
  background: rgba(15, 15, 20, 0.45); 
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Base structural modifications to allow custom background */
.custom-bg-root {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.custom-bg-root::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5); /* Dimming overlay */
}

/* Adjust application container when using custom bg */
.app-container.has-custom-bg {
  background-color: transparent !important;
  box-shadow: none;
}

.has-custom-bg .premium-header {
  background: rgba(0,0,0,0.3);
  color: white;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.has-custom-bg .bottom-nav {
  background: rgba(0,0,0,0.5);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.has-custom-bg .nav-item {
  color: rgba(255,255,255,0.6);
}

.has-custom-bg .nav-item.active {
  color: #fff;
}

/* Glassmorphism for cards in custom bg mode */
.has-custom-bg .card, 
.has-custom-bg .premium-card,
.has-custom-bg .premium-header,
.has-custom-bg .modal-content {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

.has-custom-bg .card h3,
.has-custom-bg .card h4,
.has-custom-bg .premium-title,
.has-custom-bg h2,
.has-custom-bg .premium-card h2,
.has-custom-bg .premium-card h3 {
  color: white !important;
}

.has-custom-bg .card p,
.has-custom-bg .card span {
  color: rgba(255, 255, 255, 0.8) !important;
}

.has-custom-bg .hero-section {
  background: transparent !important;
}

.has-custom-bg .input-field {
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: white !important;
}

.has-custom-bg .input-label {
  color: rgba(255, 255, 255, 0.7) !important;
}

.has-custom-bg .btn-secondary {
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.has-custom-bg .premium-header h1,
.has-custom-bg .premium-header p {
  color: white !important;
}

.has-custom-bg input::placeholder,
.has-custom-bg textarea::placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

.has-custom-bg .card-icon-box {
  background: rgba(255, 255, 255, 0.15) !important;
  color: white !important;
}

/* --- Buttons --- */

.btn-main {
  background: linear-gradient(135deg, #E6BE8A, #B8860B);
  color: white;
  padding: 16px 32px;
  border-radius: 50px;
  font-weight: 800;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-gold);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(184, 134, 11, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 12px 20px;
  transition: all 0.2s ease;
  font-family: inherit;
}

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

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

.btn-primary:hover {
  background: hsl(var(--primary) / 0.9);
  box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--muted-foreground) / 0.3);
}

/* --- Modals --- */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  border-radius: 2rem 2rem 0 0;
  padding: 32px 24px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 -20px 50px rgba(0,0,0,0.1);
}

/* --- Components --- */

.input-group {
  margin-bottom: 20px;
}

.input-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  background: hsl(var(--secondary));
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--foreground);
  outline: none;
  transition: all 0.3s ease;
}

.input-field:focus {
  border-color: hsl(var(--primary));
  background: white;
}

/* --- Animations --- */

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

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

.animate-spin {
  animation: spin 1s linear infinite;
}

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

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #eee;
  border-radius: 10px;
}

/* --- Dark Theme --- */
.dark {
  --background: 240 10% 6%;
  --foreground: 0 0% 98%;
  
  --card: 240 10% 8%;
  --card-foreground: 0 0% 98%;
  --card-border: 240 10% 15%;
  
  --popover: 240 10% 8%;
  --popover-foreground: 0 0% 98%;
  
  --secondary: 240 10% 12%;
  --secondary-foreground: 0 0% 98%;

  --muted: 240 10% 12%;
  --muted-foreground: 240 5% 65%;

  --border: 240 10% 15%;
  --input: 240 10% 12%;

  --glass-bg: rgba(15, 15, 18, 0.85);
  --glass-border: rgba(255, 255, 255, 0.05);
  --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 10px 25px -5px rgba(184, 134, 11, 0.2);
}
