@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #d97706; /* Golden hue for "cristero" / light / hope */
  --secondary-light: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --bg-color: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --card-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.4);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

ul {
  list-style: none;
}

/* Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  font-size: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.23);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-light));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(245, 158, 11, 0.39);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.23);
}

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

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  transition: var(--transition);
}

.glass-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

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

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-weight: 500;
  color: var(--text-muted);
}

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

/* Hero Section */
.hero {
  margin-top: 80px;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.8) 50%, rgba(255,255,255,0) 100%);
  z-index: -1;
}

.hero-content {
  max-width: 600px;
  animation: fadeUp 1s ease-out;
}

.hero-title {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

/* Login/Auth Layout */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 2rem;
}

.auth-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  animation: zoomIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--bg-color);
}

.sidebar {
  width: 280px;
  background: white;
  border-right: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.sidebar-nav {
  padding: 2rem 1rem;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.sidebar-link:hover, .sidebar-link.active {
  background: var(--primary-light);
  color: white;
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
}

.sidebar-link i {
  font-size: 1.25rem;
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Grids & Layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

/* Status Tags */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}
.tag-success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.tag-warning { background: rgba(245, 158, 11, 0.1); color: var(--secondary-light); }
.tag-primary { background: rgba(59, 130, 246, 0.1); color: var(--primary); }

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

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Step Wizard (for forms) */
.wizard-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}
.wizard-steps::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: #e2e8f0;
  z-index: 1;
}
.step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  transition: var(--transition);
}
.step.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}
.step.completed {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}


/* =========================================
   Mobile Responsive Adjustments
   ========================================= */

@media (max-width: 768px) {
  /* Typography & Spacing */
  h1, .hero-title { font-size: 2.2rem !important; }
  h2 { font-size: 1.75rem !important; }
  .container { padding: 0 1.5rem; }
  
  /* Navbar */
  .navbar { height: auto; padding: 1rem 0; position: relative; }
  .navbar .container { flex-direction: column; gap: 1rem; }
  .navbar-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; padding: 0; }
  .hero { margin-top: 140px; } /* Adjust for taller navbar */
  .hero-actions { flex-direction: column; width: 100%; }

  /* Dashboard Layout */
  .dashboard-layout { flex-direction: column; }
  
  /* Mobile Sidebar Logic (Horizontal Tab Bar) */
  .sidebar {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 0.5rem;
    z-index: 100;
  }
  .sidebar-header { justify-content: center; height: 60px; border-bottom: none; }
  .sidebar-nav { 
    display: flex; 
    overflow-x: auto; 
    white-space: nowrap; 
    padding: 0 1rem; 
    -webkit-overflow-scrolling: touch;
    gap: 0.5rem;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-link { margin-bottom: 0; padding: 0.5rem 1rem; flex-shrink: 0; border-radius: 999px; font-size: 0.85rem; }
  .sidebar-nav p { display: none; } /* Hide section headers */
  
  .main-content { margin-left: 0; padding: 1rem; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
  
  /* Chat Layout */
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-list { max-height: 250px; }
  .chat-window { height: 60vh; }

  /* Grids & Cards */
  .grid-2, .grid-3 { grid-template-columns: 1fr; gap: 1.5rem; }
  .glass-card { padding: 1.25rem; }
  
  /* Header alignment in profile/church detail */
  header > .container > div { flex-direction: column; text-align: center; }
  
  /* Auth Card */
  .auth-card { padding: 1.5rem; }
  
  /* Tabs */
  .tabs-header { overflow-x: auto; white-space: nowrap; padding-bottom: 0.5rem; }
  .tab-btn { flex-shrink: 0; }
  
  /* Modals */
  .modal-content { padding: 1.5rem; margin: 1rem; max-height: 90vh; overflow-y: auto; }
}

@media (max-width: 480px) {
  /* Smaller phones */
  h1, .hero-title { font-size: 1.8rem !important; }
  h2 { font-size: 1.5rem !important; }
  .btn { width: 100%; justify-content: center; }
  .btn-outline, .btn-primary, .btn-secondary { margin-bottom: 0.5rem; }
  
  /* Special fix for forms where buttons shouldn't be full width if next to each other */
  form .btn { display: flex; }
}
