/* Import modern typography from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;800&family=Inter:wght@300;400;500;600&family=Rubik:ital,wght@0,300..700;1,300..700&display=swap');

:root {
  --navy-dark: #0a1128;
  --navy-primary: #1a365d;
  --navy-light: #24467d;
  --gold-primary: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-bright: #f5d76e;
  --text-white: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.7);
  --glass-bg: rgba(26, 54, 93, 0.45);
  --glass-border: rgba(212, 175, 55, 0.2);
  --glass-shadow: rgba(0, 0, 0, 0.3);
  --font-title: 'Cinzel', serif;
  --font-sans: 'Inter', sans-serif;
  --font-hebrew: 'Rubik', sans-serif;
}

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

body {
  background-color: var(--navy-dark);
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(36, 70, 125, 0.4) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(212, 175, 55, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(36, 70, 125, 0.2) 0%, transparent 40%);
  color: var(--text-white);
  font-family: var(--font-sans);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem;
  overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--navy-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--navy-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

/* Container limits for desktop view */
.container {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-bottom: 2rem;
}

/* Status Banner */
.status-banner {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  animation: fadeInDown 0.6s ease-out;
}

.status-banner.active-omer {
  background-color: rgba(20, 83, 136, 0.3);
  border-color: rgba(212, 175, 55, 0.3);
  color: var(--gold-bright);
}

.status-banner.demo-mode {
  background-color: rgba(212, 175, 55, 0.1);
  border-color: var(--glass-border);
  color: #f3e5ab;
}

/* Header */
header {
  text-align: center;
  margin-top: 0.5rem;
  animation: fadeIn 0.8s ease-out;
}

header h1 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  margin-bottom: 0.2rem;
}

header h1 span {
  display: block;
  font-family: var(--font-hebrew);
  font-size: 1.5rem;
  letter-spacing: 0;
  font-weight: 500;
  margin-top: 0.25rem;
}

header .subtitle {
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Main Card */
.main-card {
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 
    0 10px 30px var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  transition: border-color 0.5s ease, box-shadow 0.5s ease;
}

.main-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

/* Counter Display Ring */
.counter-ring-outer {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--navy-primary) 50%, var(--navy-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 0 25px var(--gold-glow),
    inset 0 0 15px rgba(0, 0, 0, 0.6);
  border: 2px solid var(--gold-primary);
  margin: 0.5rem 0;
  transition: transform 0.3s ease;
}

.counter-ring-outer:hover {
  transform: scale(1.05);
}

.counter-ring-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.day-number {
  font-size: 3.5rem;
  font-weight: 800;
  font-family: var(--font-title);
  color: var(--gold-bright);
  line-height: 1;
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.day-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Sephirah Badge */
.sephirah-section {
  text-align: center;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
  width: 100%;
  padding-bottom: 1.25rem;
}

.sephirah-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background-color: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 0.5rem;
}

.sephirah-title-heb {
  font-family: var(--font-hebrew);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-white);
  margin-bottom: 0.2rem;
}

.sephirah-title-eng {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-white);
}

.sephirah-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-style: italic;
}

/* Liturgy Layout: English above Hebrew */
.liturgy-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.liturgy-block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(10, 17, 40, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.liturgy-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold-primary);
  font-weight: 600;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  padding-bottom: 4px;
  margin-bottom: 2px;
}

.liturgy-text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-white);
}

.liturgy-text.english {
  text-align: left;
}

.liturgy-text.hebrew {
  font-family: var(--font-hebrew);
  font-size: 1.15rem;
  line-height: 1.6;
  text-align: right;
  direction: rtl;
}

.blessing-box {
  margin-bottom: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.blessing-title {
  font-weight: 600;
  color: var(--gold-bright);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.count-box .count-title {
  font-weight: 600;
  color: var(--gold-bright);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.count-value {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-white);
  background: rgba(212, 175, 55, 0.08);
  border-left: 2px solid var(--gold-primary);
  padding: 0.4rem 0.6rem;
  margin-top: 0.35rem;
}

.hebrew .count-value {
  border-left: none;
  border-right: 2px solid var(--gold-primary);
  padding: 0.4rem 0.6rem;
}

/* Action Button */
.action-container {
  width: 100%;
  margin-top: 0.25rem;
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--gold-primary);
  background: linear-gradient(135deg, var(--gold-primary) 0%, #b3922e 100%);
  color: var(--navy-dark);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-primary) 100%);
}

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

.btn-primary.counted {
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: none;
}

.btn-primary.counted:hover {
  background: rgba(212, 175, 55, 0.05);
}

/* Accordion Info Panel */
.info-accordion {
  width: 100%;
  background: rgba(26, 54, 93, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
}

.accordion-details {
  padding: 1rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(10, 17, 40, 0.2);
}

.accordion-summary {
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gold-bright);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  list-style: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-summary::after {
  content: '▼';
  font-size: 0.65rem;
  transition: transform 0.2s;
  color: var(--gold-primary);
}

.info-accordion[open] .accordion-summary::after {
  transform: rotate(180deg);
}

.accordion-details ul {
  padding-left: 1.25rem;
  margin-top: 0.5rem;
}

.accordion-details li {
  margin-bottom: 0.4rem;
}

/* Demo Control Panel */
.demo-panel {
  background: rgba(10, 17, 40, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  width: 100%;
  display: none; /* Shown dynamically in script.js */
  animation: fadeInUp 0.8s ease-out;
}

.demo-panel h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold-primary);
  margin-bottom: 0.75rem;
  text-align: center;
}

.demo-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.btn-demo {
  background: var(--navy-primary);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--gold-bright);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-demo:hover {
  background: var(--gold-primary);
  color: var(--navy-dark);
}

.slider-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slider-container label {
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold-primary);
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.demo-notice {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
  margin-top: 0.25rem;
}

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

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-flash {
  animation: successFlash 1s ease-out;
}

@keyframes successFlash {
  0% {
    box-shadow: 0 10px 30px var(--glass-shadow);
    border-color: var(--glass-border);
  }
  30% {
    box-shadow: 0 0 35px rgba(212, 175, 55, 0.6);
    border-color: var(--gold-primary);
  }
  100% {
    box-shadow: 0 10px 30px var(--glass-shadow);
    border-color: var(--glass-border);
  }
}

/* Confetti particles */
.confetti-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 2px;
}

/* Adjust particle animation to shoot UP from bottom and fade out */
@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100dvh) rotate(360deg);
    opacity: 0;
  }
}
