/* Modern Azan Web App - Mobile-First Responsive Design */
:root {
  --bg-primary: #0c1426;
  --bg-secondary: #162033;
  --bg-tertiary: #1f2937;
  --bg-card: #1a202c;
  --bg-input: #2d3748;
  --border: #4a5568;
  --border-light: #718096;
  --text-primary: #f7fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;
  --accent: #4299e1;
  --accent-hover: #3182ce;
  --accent-light: rgba(66, 153, 225, 0.12);
  --success: #48bb78;
  --warning: #ed8936;
  --error: #f56565;
  --gold: #f6e05e;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.2), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
  --gradient-primary: linear-gradient(135deg, #0c1426 0%, #162033 50%, #1a202c 100%);
  --gradient-card: linear-gradient(135deg, rgba(26, 32, 44, 0.95) 0%, rgba(31, 41, 55, 0.8) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--gradient-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(66, 153, 225, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(246, 224, 94, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(12, 20, 38, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  min-height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }
  .brand {
    gap: 10px;
  }
}

@media (min-width: 768px) {
  .logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }
  .brand {
    gap: 12px;
  }
}

@media (min-width: 1280px) {
  .logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
  }
}

/* Title sizing & mobile compaction */
.brand .titles {
  min-width: 0;
  overflow: hidden;
}

.brand .titles h1 { 
  font-size: 16px; 
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 480px) { .brand .titles h1 { font-size: 18px; } }
@media (min-width: 768px) { .brand .titles h1 { font-size: 20px; } }
@media (min-width: 1280px) { .brand .titles h1 { font-size: 22px; } }

@media (max-width: 420px) {
  .brand .titles .subtitle { display: none; }
}

/* Removed duplicate - already handled above */

.brand .titles .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (min-width: 480px) {
  .header-actions {
    gap: 8px;
  }
}

@media (min-width: 768px) {
  .header-actions {
    gap: 10px;
  }
}

.location {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 480px) {
  .location {
    font-size: 12px;
    max-width: 100px;
    gap: 6px;
  }
}

@media (min-width: 768px) {
  .location {
    font-size: 13px;
    max-width: 120px;
  }
}

/* Buttons */
.btn {
  background: var(--gradient-accent);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 480px) {
  .btn {
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 7px;
  }
}

@media (min-width: 768px) {
  .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
  }
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ghost:hover {
  background: var(--bg-input);
  color: var(--text-secondary);
}

/* Ad Banner */
.ad-banner {
  padding: 16px;
}

.ad-card-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.ad-card-simple:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.ad-text-link {
  font-size: 15px;
  font-weight: 500;
  flex: 1;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.ad-text-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Search Bar */
.search-bar {
  padding: 0 16px 16px;
}

.search-box {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: center;
}

.search-box input {
  flex: 1;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.suggest {
  position: absolute;
  left: 0;
  right: 80px;
  top: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  list-style: none;
  margin: 4px 0 0;
  padding: 4px 0;
  max-height: 280px;
  overflow: auto;
  display: none;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.suggest.show {
  display: block;
}

.suggest li {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 14px;
}

.suggest li:hover {
  background: var(--bg-input);
}

/* Language Switch */
.lang-switch select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  max-width: 60px;
}

@media (min-width: 480px) {
  .lang-switch select {
    padding: 7px 9px;
    font-size: 12px;
    max-width: 70px;
    border-radius: 7px;
  }
}

@media (min-width: 768px) {
  .lang-switch select {
    padding: 8px 10px;
    font-size: 13px;
    max-width: 80px;
    border-radius: 8px;
  }
}

/* Date Cards */
.dates {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 0 16px 16px;
  align-items: stretch;
}

@media (min-width: 768px) {
  .dates {
    grid-template-columns: repeat(3, 1fr);
  }
}

.date-chip {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
}

.date-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.date-chip .label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-chip .value {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Next Prayer */
.next-prayer {
  margin: 0 16px 16px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.np-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.np-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.np-title {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--text-primary);
}

.np-countdown {
  font-size: 24px;
  font-weight: 800;
  color: var(--gold);
  text-align: right;
  letter-spacing: 1px;
}

/* Tabs */
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px 16px;
}

.tab {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 14px;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: var(--shadow);
}

.spacer {
  flex: 1;
}

.tz {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* Panels */
.panel {
  display: none;
  padding: 0 16px 24px;
}

.panel.show {
  display: block;
}

/* Prayer Cards Grid */
.grid {
  display: grid;
  gap: 12px;
}

.grid-6 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 480px) {
  .grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card .title {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card .value {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Highlighted card (next prayer) */
.card[style*="outline"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light), var(--shadow);
}

/* Month Table */
.month-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 0 16px;
}

@media (min-width: 600px) {
  .month-controls {
    display: flex;
    gap: 16px;
  }
}

.month-controls label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.month-controls select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.month-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
  background: var(--bg-card);
}

.month-table th,
.month-table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  text-align: left;
  font-size: 14px;
}

.month-table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.month-table tbody tr:hover {
  background: var(--bg-input);
}

.month-table tbody tr.today-row {
  background: var(--accent-light);
}

.month-table tbody tr.today-row td {
  border-bottom-color: var(--accent);
}

.month-table tbody tr.today-row td:first-child {
  font-weight: 700;
  color: var(--accent);
}

/* Dialog */
.dialog {
  border: none;
  padding: 0;
  border-radius: 16px;
  width: min(480px, 95vw);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.dialog-content {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 480px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.field select {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* Qibla Section */
.qibla-section {
  padding: 0 16px 24px;
}

.qibla-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 16px;
}

.qibla-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

@media (min-width: 480px) {
  .qibla-card {
    grid-template-columns: 160px 1fr;
  }
}

.qibla-dial {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 8px solid var(--bg-tertiary);
  background: conic-gradient(from 0deg, var(--bg-secondary), var(--bg-primary));
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4), var(--shadow);
  margin: 0 auto;
}

.qibla-dial .north {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  color: var(--text-muted);
  font-size: 12px;
}

.qibla-dial .arrow {
  position: absolute;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 52px solid var(--accent);
  left: 50%;
  top: 24px;
  transform: translateX(-50%) rotate(0deg);
  transform-origin: 50% 52px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.qibla-info {
  display: grid;
  gap: 8px;
  align-content: center;
}

.qibla-info .muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* Footer */
.site-footer {
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.site-footer .links a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer .links a:hover {
  text-decoration: underline;
}

/* SEO Content */
.seo-content {
  padding: 16px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.seo-content h2 {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 12px;
}

.seo-content p {
  margin-bottom: 12px;
}

.seo-content a {
  color: var(--accent);
  text-decoration: none;
}

.seo-content a:hover {
  text-decoration: underline;
}

/* CTA grid */
.cta-grid { padding: 16px; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .cta-grid { grid-template-columns: repeat(3, 1fr); } }
.product-card { background: var(--gradient-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.product-card h3 { margin: 0 0 8px; }
.product-card ul { margin: 0 0 12px; padding-left: 18px; color: var(--text-muted); }

/* Testimonials */
.testimonials { padding: 8px 16px 24px; display: grid; gap: 8px; }
.testimonials .quote { background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text-secondary); }
.testimonials .quote span { color: var(--text-muted); font-size: 12px; margin-left: 6px; }

/* Subscribe/notify removed per request */

/* Loading States */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.06)
  );
  background-size: 300% 100%;
  animation: shimmer 2s infinite;
}

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

/* Responsive Typography */
@media (max-width: 480px) {
  .np-countdown {
    font-size: 20px;
  }
  
  .card .value {
    font-size: 16px;
  }
  
  .date-chip .value {
    font-size: 14px;
  }
}

/* Smooth Transitions */
* {
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Focus Styles */
button:focus,
select:focus,
input:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
  body {
    background: var(--gradient-primary);
  }
}