/* masjid/assets/css/public.css */
:root {
  /* Warna Utama - Emerald Green Modern */
  --primary: #059669;       /* Emerald 600 */
  --primary-dark: #047857;  /* Emerald 700 */
  --primary-light: #d1fae5; /* Emerald 100 */
  --accent: #f59e0b;        /* Amber 500 */
  
  /* Background & Text */
  --bg-body: #f3f4f6;       /* Gray 100 */
  --bg-card: #ffffff;
  --text-main: #1f2937;     /* Gray 800 */
  --text-muted: #6b7280;    /* Gray 500 */
  
  /* Dimensi Layout */
  --sidebar-width: 280px;
  --header-height: 70px;
  --radius: 16px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden; /* Mencegah scroll horizontal di HP */
}
a { text-decoration: none; color: inherit; transition: 0.2s; }
ul { list-style: none; }

/* --- 1. PRELOADER (LOADING SCREEN) --- */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: #ffffff;
  display: flex; justify-content: center; align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader {
  width: 50px; aspect-ratio: 1;
  border-radius: 50%;
  border: 8px solid #0000;
  border-right-color: var(--primary);
  position: relative;
  animation: l24 1s infinite linear;
}
.loader:before, .loader:after {
  content: ""; position: absolute; inset: -8px;
  border-radius: 50%;
  border: inherit;
  animation: inherit; animation-duration: 2s;
}
.loader:after { animation-duration: 4s; }
@keyframes l24 { 100% { transform: rotate(1turn) } }

body.loaded #preloader { opacity: 0; visibility: hidden; }

/* --- 2. LAYOUT: SIDEBAR & MAIN --- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid #e5e7eb;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 50;
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
  height: var(--header-height);
  display: flex; align-items: center; padding: 0 1.5rem;
  font-size: 1.25rem; font-weight: 800; color: var(--primary);
  border-bottom: 1px solid #f3f4f6;
  gap: 12px;
}
.brand-logo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }

.sidebar-menu {
  flex: 1; overflow-y: auto; padding: 1.5rem 1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-item:hover {
  background-color: #f9fafb; color: var(--primary);
}
.nav-item.active {
  background-color: var(--primary-light); color: var(--primary-dark);
  font-weight: 600;
}
.nav-icon { font-size: 1.2rem; min-width: 24px; text-align: center; }

.sidebar-footer {
  padding: 1rem; border-top: 1px solid #f3f4f6;
  text-align: center; font-size: 0.8rem; color: var(--text-muted);
}

/* Mobile Header (Hamburger) */
.mobile-topbar {
  display: none; /* Hidden on Desktop */
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #e5e7eb;
  z-index: 40;
  align-items: center; justify-content: space-between;
  padding: 0 1.25rem;
}
.mobile-brand { font-weight: 700; font-size: 1.1rem; color: var(--primary); }
.menu-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-main); }

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width); /* Space for sidebar */
  padding: 2rem;
  transition: margin-left 0.3s;
}

/* Overlay for Mobile Sidebar */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 45;
  opacity: 0; visibility: hidden; transition: 0.3s;
  backdrop-filter: blur(2px);
}
.overlay.active { opacity: 1; visibility: visible; }

/* --- 3. COMPONENTS UI --- */

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #065f46 100%);
  color: white;
  border-radius: var(--radius);
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 2.5rem;
}
/* Islamic Pattern Overlay */
.hero-banner::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 20px 20px; opacity: 0.6;
}
.hero-inner { position: relative; z-index: 2; max-width: 700px; }
.hero-title { font-size: 2rem; font-weight: 800; margin-bottom: 0.75rem; line-height: 1.2; }
.hero-subtitle { font-size: 1rem; opacity: 0.9; margin-bottom: 2rem; }
.hero-btns { display: flex; gap: 1rem; }
.btn {
  display: inline-block; padding: 0.75rem 1.5rem;
  border-radius: 99px; font-weight: 600; font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none; cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn-white { background: white; color: var(--primary); box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-glass { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.3); }

/* Section Headers */
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid #e5e7eb;
}
.sec-title { font-size: 1.5rem; font-weight: 700; color: var(--text-main); position: relative; }
.sec-title::after {
  content: ""; position: absolute; bottom: -0.6rem; left: 0;
  width: 50px; height: 4px; background: var(--primary); border-radius: 2px;
}
.view-all { font-size: 0.85rem; font-weight: 600; color: var(--primary); }

/* Cards Styling */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.m-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: 0.3s ease;
  display: flex; flex-direction: column;
  height: 100%;
}
.m-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

.m-card-thumb {
  height: 180px; width: 100%; object-fit: cover;
  background: #e5e7eb;
}
.m-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.m-card-meta { font-size: 0.75rem; color: var(--primary); font-weight: 700; text-transform: uppercase; margin-bottom: 0.5rem; }
.m-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.4; color: var(--text-main); }
.m-card-desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-card-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid #f3f4f6; }

/* List Style (Agenda) */
.list-card {
  display: flex; gap: 1rem; padding: 1rem;
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1rem;
  align-items: center; transition: 0.2s;
}
.list-card:hover { transform: translateX(5px); border-left: 4px solid var(--primary); }
.date-box {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 0.5rem 1rem; border-radius: 12px; text-align: center; min-width: 70px;
}
.date-num { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.date-month { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }

/* Footer */
.main-footer {
  text-align: center; padding: 2rem; color: var(--text-muted); font-size: 0.85rem;
  border-top: 1px solid #e5e7eb; margin-top: 3rem;
}

/* --- 4. RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 992px) {
  /* Tablet & Mobile */
  .sidebar { transform: translateX(-100%); } /* Hide sidebar initially */
  .sidebar.open { transform: translateX(0); }
  
  .mobile-topbar { display: flex; } /* Show mobile header */
  
  .main-content {
    margin-left: 0;
    padding: 1.25rem;
    padding-top: calc(var(--header-height) + 1.25rem); /* Adjust for fixed header */
  }
  
  .hero-title { font-size: 1.5rem; }
  .grid-container { grid-template-columns: 1fr; } /* Stack cards on mobile */
  .m-card-thumb { height: 200px; }
}