/* ==========================================================================
   Surau Al-Mustaqim Vista Seri Putra CSS - Modern Islamic Minimalist Design
   ========================================================================== */

:root {
  /* Color Palette */
  --primary: #22c55e;        /* Emerald Green */
  --primary-hover: #16a34a;  /* Darker Green */
  --primary-light: #f0fdf4;  /* Very Light Green */
  --primary-dark: #14532d;   /* Deep Forest Green */
  --secondary: #ffffff;      /* White */
  
  --accent: #f59e0b;         /* Amber/Gold for alerts, highlights */
  --accent-light: #fef9c3;   /* Light Gold */
  --accent-dark: #b45309;    /* Dark Amber */

  --danger: #ef4444;         /* Red for emergencies & deletes */
  --danger-light: #fee2e2;   /* Light Red */
  
  --bg-app: #f1f5f9;         /* Slate Light Gray for container surrounding background */
  --bg-page: #f8fafc;        /* App Canvas background */
  --bg-surface: #ffffff;     /* Card background */
  
  --text-main: #0f172a;      /* Slate 900 */
  --text-muted: #64748b;     /* Slate 500 */
  --text-light: #94a3b8;     /* Slate 400 */
  --text-on-primary: #ffffff;
  
  --border: #e2e8f0;         /* Slate 200 */
  --border-light: #f1f5f9;   /* Slate 100 */
  
  /* Typography & Layout spacing */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.07), 0 8px 10px -6px rgba(0, 0, 0, 0.07);
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & scrollbars */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App container forcing mobile responsive constraints on desktop */
.app-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  min-height: 100vh;
  background-color: var(--bg-page);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

@media (max-width: 480px) {
  .app-container {
    max-width: 100%;
    border-left: none;
    border-right: none;
  }
}

/* Scrollable main view area */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 90px; /* Space for fixed bottom navigation */
  scroll-behavior: smooth;
  position: relative;
  background-image: 
    radial-gradient(circle at 100% 0%, rgba(34, 197, 94, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(245, 158, 11, 0.03) 0%, transparent 40%);
}

.app-main::-webkit-scrollbar {
  width: 6px;
}
.app-main::-webkit-scrollbar-track {
  background: transparent;
}
.app-main::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: var(--radius-xs);
}

/* Header styling */
header {
  background-color: var(--bg-surface);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.header-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.header-title span {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.header-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  z-index: 100;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  width: 60px;
  height: 100%;
  gap: 4px;
  transition: var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: transform var(--transition-normal), color var(--transition-fast);
}

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

.nav-item.active svg {
  stroke: var(--primary);
  transform: translateY(-2px);
}

/* Page Containers (SPA views) */
.page {
  display: none;
  padding: 20px;
  animation: slideUp var(--transition-normal);
}

.page.active {
  display: block;
}

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

/* Geometric Mosque Border Decorative Element */
.islamic-header-pattern {
  position: relative;
  background-color: var(--primary-dark);
  color: var(--text-on-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.islamic-header-pattern::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(rgba(255, 255, 255, 0.06) 10%, transparent 10%),
              radial-gradient(rgba(255, 255, 255, 0.06) 10%, transparent 10%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  opacity: 0.4;
}

.islamic-header-pattern * {
  position: relative;
  z-index: 2;
}

/* General typography elements */
h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.4px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h2 svg {
  color: var(--primary);
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.date-badge-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hijri-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.gregorian-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Card components */
.card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* Prayer Time Dashboard Card & Detailed page */
.prayer-countdown-container {
  margin-top: 16px;
}

.countdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.8);
}

.countdown-timer {
  font-size: 2rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1.2;
}

.countdown-target {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
}

/* Prayer List Grid */
.prayer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.prayer-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background-color: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.prayer-time-row.active {
  background-color: var(--primary-light);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.prayer-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prayer-name svg {
  color: var(--primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.prayer-time-row.active .prayer-name svg {
  opacity: 1;
}

.prayer-time-val {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.prayer-time-row.active .prayer-time-val {
  color: var(--primary-dark);
}

/* Announcement Cards */
.announcement-item {
  border-left: 4px solid var(--primary);
}

.announcement-item.emergency {
  border-left-color: var(--danger);
}

.announcement-item.program {
  border-left-color: var(--accent);
}

.announcement-item.death {
  border-left-color: #64748b; /* Slate Gray */
}

.tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-general {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.tag-program {
  background-color: var(--accent-light);
  color: var(--accent-dark);
}

.tag-emergency {
  background-color: var(--danger-light);
  color: var(--danger);
}

.tag-death {
  background-color: #f1f5f9;
  color: #475569;
}

.announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.announcement-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.announcement-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
}

/* Events Calendar Cards */
.event-item {
  position: relative;
  padding-left: 16px;
}

.event-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 2px;
  background-color: var(--border);
}

.event-speaker {
  font-size: 0.8rem;
  color: var(--primary-dark);
  font-weight: 600;
  margin: 4px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-details {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.event-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Donations card & details */
.donation-progress-container {
  margin-top: 16px;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background-color: var(--border-light);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-hover));
  border-radius: 5px;
  width: 0%;
  transition: width 0.8s ease-in-out;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.progress-percent {
  color: var(--primary);
}

.qr-code-placeholder {
  width: 180px;
  height: 180px;
  margin: 16px auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 8px;
}

.bank-info {
  background-color: var(--bg-page);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.bank-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.bank-row:last-child {
  margin-bottom: 0;
}

.bank-label {
  color: var(--text-muted);
}

.bank-value {
  font-weight: 700;
  color: var(--text-main);
  user-select: all;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary);
  color: var(--text-on-primary);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  width: 100%;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.15);
}

.btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.25);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--bg-page);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-secondary:hover {
  background-color: var(--border-light);
  color: var(--text-main);
  box-shadow: none;
}

.btn-danger {
  background-color: var(--danger);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}
.btn-danger:hover {
  background-color: #dc2626;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.25);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.75rem;
  width: auto;
}

/* AJK Directory Committee styling */
.ajk-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ajk-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
}

.ajk-avatar {
  width: 44px;
  height: 44px;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: 2px solid var(--secondary);
  box-shadow: var(--shadow-sm);
}

.ajk-info {
  flex: 1;
  margin-left: 12px;
}

.ajk-role {
  font-size: 0.75rem;
  color: var(--primary-dark);
  font-weight: 700;
}

.ajk-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.ajk-phone {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ajk-actions {
  display: flex;
  gap: 6px;
}

.ajk-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background-color: var(--bg-page);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.ajk-action-btn:hover {
  background-color: #25d366; /* WhatsApp Green */
  color: var(--secondary);
  border-color: #25d366;
}

/* Home Quick Links grid */
.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.quick-link-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 12px 6px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.7rem;
  font-weight: 700;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-link-btn:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.quick-link-btn svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

/* Form Styling & Search Input */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--bg-surface);
  color: var(--text-main);
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.search-container {
  position: relative;
  margin-bottom: 16px;
}

.search-input {
  padding-left: 40px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Admin Dashboard layout */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.admin-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 16px;
  overflow-x: auto;
  gap: 4px;
}

.admin-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  margin-bottom: -2px;
}

.admin-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Dialog & Modal */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 200;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%;
  max-height: 85%;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  animation: slideUpModal var(--transition-normal);
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-close:hover {
  background-color: var(--border-light);
}

/* List with Admin actions */
.list-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}

/* App Install Prompt Banner */
.install-banner {
  background-color: var(--primary-dark);
  color: var(--text-on-primary);
  padding: 14px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideUp 0.3s ease-out;
}

.install-banner.active {
  display: flex;
}

.install-text {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
}

.install-btn {
  background-color: var(--accent);
  color: #451a03;
  border: none;
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

/* Alert dialog */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--accent-light);
  color: var(--accent-dark);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Helper spacing utility classes */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.flex-row-gap-2 { display: flex; gap: 8px; }
