/* ==========================================================================
   ASHRAFUL MADARIS - Component Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Site Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: var(--header-height);
  background-color: var(--bg-header);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.25rem;
}

/* Brand */
.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #064e3b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(13, 120, 87, 0.3);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
  margin-top: 1px;
}

/* Nav Menu */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 auto;
}

.nav-link {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: var(--transition);
}

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

.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 600;
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.district-select-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.district-select-wrap select {
  cursor: pointer;
  font-weight: 500;
  color: var(--text-primary);
}

.lang-switch {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
}

.lang-btn {
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
}

.lang-btn.active {
  background: var(--primary);
  color: #ffffff;
}

.mobile-menu-btn {
  display: none;
}

/* --------------------------------------------------------------------------
   2. Live Prayer Status & Date Bar
   -------------------------------------------------------------------------- */
.prayer-status-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
  position: relative;
  z-index: 2;
}

.status-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.dates-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.date-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.date-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--text-muted);
  opacity: 0.5;
}

.next-prayer-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(217, 119, 6, 0.08) 100%);
  border: 1px solid var(--border-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
}

.live-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(13, 120, 87, 0.7);
  animation: pulse-ring 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(13, 120, 87, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(13, 120, 87, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(13, 120, 87, 0);
  }
}

.next-prayer-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.countdown-digits {
  font-family: var(--font-english);
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   3. Main Portal 2-Column Layout (islamijindegi style)
   -------------------------------------------------------------------------- */
.portal-layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0 3rem;
  min-height: calc(100vh - var(--header-height) - 60px);
}

/* Left Column */
.portal-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Category Grid (12 core items) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 0.75rem;
  text-align: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0;
  transition: var(--transition);
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-primary);
  box-shadow: var(--shadow-md);
}

.category-card:hover::before {
  opacity: 1;
}

.category-icon-box {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  transition: var(--transition);
}

.category-card:hover .category-icon-box {
  background: var(--primary);
  color: #ffffff;
  transform: scale(1.08);
}

.category-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.category-arrow {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(-4px);
  transition: var(--transition);
}

.category-card:hover .category-arrow {
  opacity: 1;
  transform: translateX(0);
  background: var(--primary-light);
  color: var(--primary);
}

/* News Ticker */
.news-ticker-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(90deg, rgba(13, 120, 87, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1rem;
}

.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--primary);
  color: #ffffff;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.ticker-marquee {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.ticker-track {
  display: inline-block;
  animation: marquee 25s linear infinite;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Right Column (Dynamic Content Showcase) */
.portal-right {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: 100%;
}

.showcase-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.showcase-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-main);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.tab-btn {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.showcase-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 600px;
}

/* Feed Item Cards */
.feed-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  align-items: flex-start;
}

.feed-item:last-child {
  border-bottom: none;
}

.feed-item:hover {
  background-color: var(--primary-light);
  transform: translateX(3px);
}

.feed-thumb {
  width: 72px;
  height: 96px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
}

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

.feed-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.feed-author {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.feed-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   4. Sticky Bottom Audio Player Bar
   -------------------------------------------------------------------------- */
.global-audio-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1.25rem;
  display: none; /* activated when audio starts */
  animation: slideUp 0.3s ease-out;
}

.global-audio-player.active {
  display: block;
}

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

.audio-player-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.player-track-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 200px;
}

.player-track-cover {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.player-track-meta {
  display: flex;
  flex-direction: column;
}

.player-track-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.player-track-speaker {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex: 1;
  max-width: 600px;
}

.player-btn-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.player-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(13, 120, 87, 0.3);
  transition: var(--transition);
}

.player-play-btn:hover {
  transform: scale(1.06);
  background: var(--primary-hover);
}

.player-progress-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.player-time {
  font-family: var(--font-english);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-slider {
  flex: 1;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-color);
  border-radius: 4px;
  outline: none;
}

.player-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   5. Interactive Digital Tasbeeh Component
   -------------------------------------------------------------------------- */
.tasbeeh-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  max-width: 420px;
  margin: 0 auto;
}

.tasbeeh-screen {
  background: #0f172a;
  color: #38bdf8;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  font-family: var(--font-english);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  margin-bottom: 1.5rem;
  position: relative;
}

.tasbeeh-target-label {
  font-size: 0.85rem;
  color: #94a3b8;
  position: absolute;
  top: 0.75rem;
  left: 1rem;
}

.tasbeeh-count-big {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  margin: 0.5rem 0 0;
  letter-spacing: 0.05em;
}

.tasbeeh-lap {
  font-size: 0.9rem;
  color: #34d399;
  margin-top: 0.35rem;
}

.tasbeeh-touch-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #064e3b 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 24px rgba(13, 120, 87, 0.35), inset 0 2px 4px rgba(255, 255, 255, 0.2);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.tasbeeh-touch-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(13, 120, 87, 0.4);
}

/* --------------------------------------------------------------------------
   6. Prayer Times Table & Grid
   -------------------------------------------------------------------------- */
.prayer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.prayer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.prayer-card.current-waqt {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-card) 100%);
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(13, 120, 87, 0.18);
}

.prayer-card.current-waqt::after {
  content: "চলতি ওয়াক্ত";
  position: absolute;
  top: 0.4rem;
  right: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.waqt-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.waqt-time {
  font-family: var(--font-english);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   7. Modals
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   8. Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3.5rem 0 2rem;
  position: relative;
  z-index: 10;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-col h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 32px;
  height: 2.5px;
  background: var(--primary);
  border-radius: 2px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(4px);
}

.app-badges-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.app-badge-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: var(--transition);
}

.app-badge-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.footer-bottom {
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   7. Mobile App Bottom Navigation Bar
   -------------------------------------------------------------------------- */
.mobile-app-bottom-nav {
  display: none; /* Shown on mobile & tablet via responsive.css */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 150;
  background-color: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  user-select: none;
  -webkit-user-select: none;
}

.bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 62px;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 0.25rem;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  height: 100%;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

.bottom-nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

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

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

.bottom-nav-item.active .bottom-nav-label {
  color: var(--primary);
  font-weight: 700;
}

.bottom-nav-item.active::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 22px;
  height: 3px;
  background-color: var(--primary);
  border-radius: var(--radius-full);
}

/* Reusable Video Player Modal */
.video-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.video-modal-overlay.open {
  display: flex;
}
.video-modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 860px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalScaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalScaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.video-frame-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000000;
}
.video-frame-container iframe,
.video-frame-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.video-modal-header {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.video-modal-footer {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-card-subtle);
  flex-wrap: wrap;
}

