/* ==========================================================================
   MAAN MANDIR MOBILE DEVOTEE PORTAL - DESIGN SYSTEM & STYLES
   Custom Palette:
   Dark Blue:  #032a61 (Deep Royal Navy Blue)
   Light Blue: #51bedb (Vibrant Aqua-Blue)
   Font Scale: Increased font size scheme for effortless readability
   ========================================================================== */

:root {
  /* User Specified Blue Palette */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F4F7FA;
  --bg-tertiary: #EAF6F9;
  --bg-card: #FFFFFF;
  
  --primary-blue: #032a61;        /* Deep Royal Navy Blue */
  --primary-blue-hover: #021e47;
  --accent-blue: #51bedb;         /* Vibrant Aqua-Blue */
  --light-blue: #C4ECF5;
  --ice-blue: #EAF6F9;
  
  --text-dark: #031D42;
  --text-medium: #0F2D54;
  --text-muted: #4B6382;
  --text-light: #7E97B5;
  --text-white: #FFFFFF;
  
  --gold-accent: #F59E0B;
  --gold-dark: #D97706;
  --gold-light: #FEF3C7;
  
  --live-red: #E53E3E;
  --live-red-light: #FFF5F5;
  
  --border-light: #DFE7F0;
  --border-blue: #8BD4E6;
  
  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px rgba(3, 42, 97, 0.08);
  --shadow-md: 0 4px 14px rgba(3, 42, 97, 0.12);
  --shadow-lg: 0 10px 25px rgba(3, 42, 97, 0.18);
  --shadow-float: 0 12px 30px rgba(3, 42, 97, 0.22);

  /* Radius & Transitions */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-secondary);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
}

#app-root {
  width: 100%;
  max-width: 520px; /* Slightly roomier mobile frame */
  background: var(--bg-primary);
  min-height: 100vh;
  position: relative;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  padding-bottom: 100px;
}

/* Header & Top Bar */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 2px solid var(--light-blue);
  box-shadow: var(--shadow-sm);
}

.brand-title-group h1 {
  font-size: 22px;               /* Larger Brand Title */
  font-weight: 800;
  color: var(--primary-blue);
  line-height: 1.1;
  letter-spacing: -0.3px;
}

.brand-title-group span {
  font-size: 13px;               /* Larger Subtitle */
  color: var(--text-muted);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: var(--bg-tertiary);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--light-blue);
  transform: scale(1.05);
}

.notification-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--live-red);
  color: var(--text-white);
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* 🔴 LIVE WEBCAST PULSING BANNER */
.live-header-banner {
  background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
  color: var(--text-white);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;               /* Larger Live Text */
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.30);
  animation: glowPulse 2s infinite ease-in-out;
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(229, 62, 62, 0.30); }
  50% { box-shadow: 0 4px 20px rgba(229, 62, 62, 0.50); }
}

.live-badge-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  background-color: var(--text-white);
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: var(--text-white);
  border-radius: 50%;
  animation: pulse-ring 1.5s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes pulse-ring {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.watch-now-btn {
  background: var(--text-white);
  color: var(--live-red);
  font-size: 12px;               /* Larger Button Text */
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search Bar Component */
.search-container {
  padding: 12px 18px 16px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper svg {
  position: absolute;
  left: 16px;
  color: var(--primary-blue);
}

.search-input {
  width: 100%;
  padding: 13px 18px 13px 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 15px;               /* Larger Search Text */
  color: var(--text-dark);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  background: var(--bg-primary);
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(3, 42, 97, 0.15);
}

/* App Main Content Container */
.main-content {
  flex: 1;
  padding: 18px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.active {
  display: block;
}

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

/* Section Titles */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 19px;               /* Larger Section Title */
  font-weight: 800;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-icon {
  color: var(--primary-blue);
}

.see-all-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-blue);
  text-decoration: none;
  cursor: pointer;
}

/* Hero Carousel / Banner */
.hero-card {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-md);
  margin-bottom: 22px;
}

.hero-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(3, 42, 97, 0.94) 100%);
  padding: 18px;
  color: var(--text-white);
}

.hero-tag {
  background: var(--gold-accent);
  color: var(--text-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 6px;
}

.hero-title {
  font-size: 21px;               /* Larger Hero Title */
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 4px;
}

.hero-subtitle {
  font-size: 14px;               /* Larger Subtitle */
  color: rgba(255, 255, 255, 0.92);
}

/* Grid Quick Action Tiles */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.grid-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.grid-tile:hover, .grid-tile:active {
  border-color: var(--border-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--ice-blue);
}

.tile-icon-container {
  width: 50px;                   /* Larger Icon Container */
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: var(--bg-tertiary);
  color: var(--primary-blue);
}

.tile-title {
  font-size: 16px;               /* Larger Tile Title */
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.tile-desc {
  font-size: 13px;               /* Larger Description */
  color: var(--text-muted);
}

/* "NEW" & "LIVE" Badges on Tiles */
.badge-new {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-blue);
  color: var(--text-white);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(81, 190, 219, 0.4);
}

.badge-live-pulse {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--live-red);
  color: var(--text-white);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: pulse-ring 2s infinite;
}

/* Feature Cards & List View Items */
.content-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.content-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.content-card:hover {
  border-color: var(--border-blue);
  box-shadow: var(--shadow-md);
}

.card-thumb {
  width: 72px;                   /* Larger Thumbnail */
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  position: relative;
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 16px;               /* Larger Item Title */
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 13px;               /* Larger Meta Info */
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-action-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--primary-blue);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: var(--transition);
}

.card-action-btn:hover {
  background: var(--primary-blue);
  color: var(--text-white);
}

/* PDF Book Reader & Catalog Cards */
.book-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 16px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.book-cover {
  width: 80px;                   /* Larger Book Cover */
  height: 110px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #032a61 0%, #51bedb 100%);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.book-cover-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.book-title {
  font-size: 17px;               /* Larger Book Title */
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.book-desc {
  font-size: 13px;               /* Larger Book Subtitle */
  color: var(--text-muted);
  margin-bottom: 12px;
}

.book-buttons {
  display: flex;
  gap: 10px;
}

.btn-primary {
  background: var(--primary-blue);
  color: var(--text-white);
  border: none;
  padding: 10px 18px;            /* Roomier Buttons */
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-blue-hover);
}

.btn-outline {
  background: transparent;
  color: var(--primary-blue);
  border: 1.5px solid var(--primary-blue);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-outline:hover {
  background: var(--bg-tertiary);
}

/* Maanini Portal Special Hero Banner */
.maanini-hero-card {
  background: linear-gradient(135deg, #032a61 0%, #0F2D54 100%);
  color: var(--text-white);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.maanini-hero-card::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 130px;
  height: 130px;
  background: rgba(81, 190, 219, 0.35);
  border-radius: 50%;
  filter: blur(30px);
}

.maanini-tag {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: var(--gold-accent);
  font-size: 12px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 12px;
}

/* Devotee Updates Notification Drawer (Slide-Over Panel) */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 42, 97, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer-overlay.active {
  display: block;
  opacity: 1;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: -100%;
  width: 88%;
  max-width: 400px;
  height: 100%;
  background: var(--bg-primary);
  z-index: 201;
  box-shadow: var(--shadow-float);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer-panel.active {
  right: 0;
}

.drawer-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-close-btn {
  background: var(--bg-secondary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.notification-item {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  margin-bottom: 12px;
  border-left: 5px solid var(--primary-blue);
}

.notification-item.unread {
  background: var(--ice-blue);
  border-left-color: var(--live-red);
}

.notification-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Floating Audio Player Bar */
.audio-floating-player {
  position: fixed;
  bottom: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 480px;
  background: var(--text-dark);
  color: var(--text-white);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  display: none;
}

.audio-floating-player.active {
  display: flex;
}

.audio-track-info {
  flex: 1;
  min-width: 0;
}

.audio-track-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-track-author {
  font-size: 12px;
  color: var(--text-light);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-control-btn {
  background: transparent;
  border: none;
  color: var(--text-white);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-play-main {
  background: var(--primary-blue);
}

/* Bottom Mobile Tab Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 12px;
  z-index: 99;
  box-shadow: 0 -4px 18px rgba(3, 42, 97, 0.08);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;               /* Larger Bottom Nav Labels */
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  padding: 2px 10px;
}

.nav-item.active {
  color: var(--primary-blue);
  font-weight: 800;
}

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

.nav-item-badge {
  position: absolute;
  top: 0;
  right: 12px;
  width: 9px;
  height: 9px;
  background: var(--live-red);
  border-radius: 50%;
}

/* Modal Popup for PDF Reader / Video Player */
.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 42, 97, 0.7);
  backdrop-filter: blur(5px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-float);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-secondary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}
