/* ==========================================================================
   Janmangal Portal — Mobile-First Modern Design System & CSS
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Gujarati:wght@400;600;700&display=swap');

:root {
  --primary: #e65100;
  --primary-light: #ff7700;
  --primary-dark: #b23c00;
  --accent-gold: #ffb70d;

  --bg-dark: #090d16;
  --card-bg: rgba(22, 30, 46, 0.85);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-hover-border: rgba(255, 119, 0, 0.3);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --success: #10b981;
  --error: #ef4444;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 8px 32px rgba(230, 81, 0, 0.25);
  --shadow-card: 0 10px 30px -5px rgba(0, 0, 0, 0.4);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Sans Gujarati', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(230, 81, 0, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 90%, rgba(255, 183, 13, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  padding-bottom: 80px; /* Space for mobile nav */
}

/* ==========================================================================
   Skeleton Loading Animation System
   ========================================================================== */

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.skeleton-text {
  height: 14px;
  width: 65%;
  margin: 4px 0;
}

.skeleton-title {
  height: 24px;
  width: 75%;
}

.skeleton-count {
  height: 64px;
  width: 40%;
  margin: 12px auto;
  border-radius: var(--radius-md);
}

.skeleton-val {
  height: 28px;
  width: 50%;
  border-radius: var(--radius-sm);
}

.skeleton-badge {
  height: 24px;
  width: 140px;
  border-radius: 20px;
}

/* ==========================================================================
   Header & Brand Banner
   ========================================================================== */

.app-header {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent-gold));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(230, 81, 0, 0.3);
  font-size: 20px;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 4px 12px rgba(230, 81, 0, 0.4);
}

.login-logo-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-gold);
  box-shadow: 0 6px 20px rgba(230, 81, 0, 0.4);
  margin: 0 auto 16px auto;
  display: block;
}

.profile-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-gold);
  box-shadow: 0 6px 18px rgba(230, 81, 0, 0.4);
  margin: 0 auto 12px auto;
  display: block;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Desktop Navigation */
.desktop-nav {
  display: none;
  gap: 12px;
  align-items: center;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
  color: var(--primary-light);
  background: rgba(230, 81, 0, 0.12);
}

.logout-btn {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  z-index: 1000;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  min-width: 64px;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

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

.mobile-nav-item.active svg {
  filter: drop-shadow(0 2px 6px rgba(255, 119, 0, 0.4));
}

/* Container & Cards */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 16px;
  width: 100%;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: var(--card-hover-border);
}

/* ==========================================================================
   Welcome & Hero Banner
   ========================================================================== */

.welcome-banner {
  background: linear-gradient(135deg, rgba(230, 81, 0, 0.25) 0%, rgba(255, 183, 13, 0.15) 100%);
  border: 1px solid rgba(255, 119, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.welcome-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.welcome-blessing {
  font-family: 'Noto Sans Gujarati', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.member-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
}

.group-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Hero Today's Count Card */
.hero-card {
  background: linear-gradient(135deg, rgba(230, 81, 0, 0.35) 0%, rgba(255, 119, 0, 0.15) 100%);
  border: 2px solid var(--primary);
  text-align: center;
  padding: 32px 20px;
  box-shadow: var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.hero-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.hero-count {
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 30%, #ffd54f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 10px 0;
}

.hero-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 119, 0, 0.2);
}

.activity-date {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.activity-count {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(255, 183, 13, 0.1);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 183, 13, 0.2);
}

/* ==========================================================================
   Login Page Styling
   ========================================================================== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 24px;
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent-gold));
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-field {
  width: 100%;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition-fast);
  outline: none;
  min-height: 48px; /* Touch target */
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.25);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(230, 81, 0, 0.35);
  transition: var(--transition-fast);
  min-height: 48px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(230, 81, 0, 0.45);
}

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

.alert-box {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 18px;
  display: none;
  white-space: pre-line;
  text-align: left;
}

.alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-info {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

/* Filter & Pagination controls */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.select-field {
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
  min-height: 44px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.page-btn {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Profile details table */
.profile-group {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-group:last-child {
  border-bottom: none;
}

.profile-label {
  color: var(--text-muted);
  font-weight: 500;
}

.profile-val {
  font-weight: 600;
  color: var(--text-main);
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
  .desktop-nav {
    display: flex;
  }
  .mobile-nav {
    display: none;
  }
}
