/* ============================================
   WELCOME BANNER / PAGE TITLE CARD STYLING
   ============================================ */
.welcome-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 1.25rem 1.75rem;
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.15);
  position: relative;
  overflow: hidden;
}

.welcome-card::after {
  content: '🕌';
  position: absolute;
  right: 5%;
  bottom: -5px;
  font-size: 5.5rem;
  opacity: 0.08;
  pointer-events: none;
}

.welcome-title {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.4rem;
}

.welcome-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
}

@media (max-width: 768px) {
  .welcome-card {
    padding: 1rem 1.25rem !important;
  }

  .welcome-title {
    font-size: 1.15rem !important;
  }

  .welcome-card::after {
    font-size: 3.5rem !important;
    bottom: -5px !important;
    right: 2% !important;
  }
}

/* ============================================
   PREMIUM CUSTOM SELECT & BOTTOM SHEET DRAWER
   ============================================ */

/* Trigger button replacing the native select */
.premium-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid rgba(30, 58, 138, 0.12);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e3a8a;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 110px;
  width: 100%;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.03);
  text-align: left;
}

/* Flex layout override: if it's placed in a flex row, keep it auto-width */
.d-flex .premium-select-trigger,
.d-flex-align-items-center .premium-select-trigger,
.gap-2 .premium-select-trigger {
  width: auto;
}

.premium-select-trigger[data-select-id="donationYearSelect"] {
  min-width: 145px;
}


.premium-select-trigger:hover {
  border-color: rgba(30, 58, 138, 0.25);
  background-color: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.06);
}

.premium-select-trigger:active {
  transform: translateY(0);
}

.premium-select-trigger:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.premium-select-trigger .trigger-caret {
  margin-left: 8px;
  color: #1e3a8a;
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.premium-select-trigger:hover .trigger-caret {
  transform: translateY(1px);
}

.premium-select-trigger .trigger-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  text-align: left;
}

/* Active filter styling for cash cards */
.filter-active-card {
  border-left: 4px solid #f59e0b !important;
  background-color: #fffbeb !important;
  border-color: rgba(245, 158, 11, 0.25) !important;
  transition: all 0.3s ease;
}

.filter-active-card-small {
  border-left: 3px solid #f59e0b !important;
  background-color: #fffbeb !important;
  border-color: rgba(245, 158, 11, 0.2) !important;
  transition: all 0.3s ease;
}


/* Bottom Sheet Container overlay styling */
.premium-bottom-sheet-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2050; /* Above regular bootstrap modals (1050) */
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.25s step-end;
}

.premium-bottom-sheet-container.active {
  visibility: visible;
  pointer-events: auto;
  transition: visibility 0s step-start;
}

/* Transparent backdrop with blur */
.premium-bottom-sheet-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.premium-bottom-sheet-container.active .premium-bottom-sheet-backdrop {
  opacity: 1;
}

/* Content Panel */
.premium-bottom-sheet-content {
  position: relative;
  width: 100%;
  max-width: 480px; /* Standard premium mobile view width */
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  box-shadow: 0 -12px 36px rgba(15, 23, 42, 0.15);
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.32, 0.94, 0.6, 1);
  z-index: 1;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.premium-bottom-sheet-container.active .premium-bottom-sheet-content {
  transform: translateY(0);
}

/* Top indicator bar */
.premium-bottom-sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: rgba(30, 58, 138, 0.15);
  border-radius: 99px;
  margin: 10px auto 4px auto;
  flex-shrink: 0;
}

/* Header styling */
.premium-bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(30, 58, 138, 0.05);
  flex-shrink: 0;
}

.premium-bottom-sheet-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: 0.3px;
}

.premium-bottom-sheet-close {
  background: rgba(30, 58, 138, 0.05);
  border: none;
  color: #1e3a8a;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.premium-bottom-sheet-close:hover {
  background: rgba(30, 58, 138, 0.1);
  color: #4c1d95;
}

/* Body / Grids for Months and Years */
.premium-bottom-sheet-body {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Months: 3-column elegant grid */
.premium-grid-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* Years: 1-column list with rounded items */
.premium-grid-years {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Item options */
.premium-option-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(30, 58, 138, 0.08);
  color: #334155;
  border-radius: 12px;
  padding: 12px 8px;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.premium-option-btn:hover {
  background: rgba(30, 58, 138, 0.04);
  border-color: rgba(30, 58, 138, 0.15);
  color: #1e3a8a;
}

.premium-option-btn:active {
  transform: scale(0.96);
}

/* Active option style */
.premium-option-btn.active {
  background: linear-gradient(135deg, #1e3a8a 0%, #4c1d95 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

/* Desktop float mode */
@media (min-width: 577px) {
  .premium-bottom-sheet-container {
    align-items: center; /* Center horizontally & vertically on desktop */
  }
  
  .premium-bottom-sheet-content {
    border-radius: 20px;
    transform: translateY(40px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.32, 0.94, 0.6, 1), opacity 0.25s ease;
  }
  
  .premium-bottom-sheet-container.active .premium-bottom-sheet-content {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Ensure the Last Updated alert stays on one line and fits mobile screens */
.alert:has(#lastUpdatedAt) {
  font-size: 0.95rem;
}

.alert:has(#lastUpdatedAt) div {
  white-space: nowrap;
}

@media (max-width: 480px) {
  .alert:has(#lastUpdatedAt) {
    font-size: 0.78rem !important;
    padding: 0.5rem 0.75rem !important;
  }
}

/* Prevent wrapping on Hadith quote card sources and optimize mobile fit */
.nudge-source {
  white-space: nowrap !important;
}

@media (max-width: 480px) {
  .islamic-nudge-card {
    padding: 1rem 1rem 1rem 1rem !important;
  }
  .nudge-source {
    font-size: 0.72rem !important;
    padding-right: 0 !important;
  }
}

/* Prevent wrapping on the admin lock warning alert and scale font size on mobile viewports */
.alert[data-non-admin-only] {
  white-space: nowrap !important;
}

@media (max-width: 480px) {
  .alert[data-non-admin-only] {
    font-size: 0.72rem !important;
    padding: 0.5rem 0.75rem !important;
  }
}

/* Prevent wrapping on welcome banner name greetings on narrow viewports */
.nowrap-name {
  white-space: nowrap !important;
}

/* Responsive adjustments to ensure summary card action buttons fit side-by-side on mobile devices */
@media (max-width: 576px) {
  .expenses-link {
    padding: 0.4rem 0.8rem !important;
    font-size: 0.75rem !important;
    gap: 0.3rem !important;
  }
}

/* Skeleton Loading animations & placeholders for layout stability */
.skeleton-loader {
    background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: 8px;
    height: 1.25rem;
    width: 100%;
    display: inline-block;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Stable widths for month/year filter selectors to avoid horizontal layout shifts */
#yearSelect, #monthSelect,
.premium-select-trigger[data-select-id="yearSelect"],
.premium-select-trigger[data-select-id="monthSelect"],
.premium-select-trigger[data-select-id="cashMonthSelect"],
.premium-select-trigger[data-select-id="reminderMonthSelect"] {
    min-width: 120px;
}

/* Custom Purple utilities */
.border-purple {
    border-color: #8b5cf6 !important;
}
.text-purple {
    color: #6b21a8 !important;
}

/* Disable slide transition animations for notifications collapse panel */
#nudgeNotificationCollapse {
    transition: none !important;
}
#nudgeNotificationCollapse.collapsing {
    transition: none !important;
    height: auto !important;
}

/* Customize active nav pills to match website premium theme */
.nav-pills .nav-link {
    color: #1e3a8a;
    transition: all 0.25s ease-in-out;
}
.nav-pills .nav-link:hover {
    color: #7c3aed;
    background-color: rgba(124, 58, 237, 0.05);
}
.nav-pills .nav-link.active {
    background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2) !important;
}
