/* ═══════════════════════════════════════════════════════
   Terço Online — Estilos Customizados
   Bootstrap 5 faz o pesado; aqui complementamos.
   ═══════════════════════════════════════════════════════ */

/* ─── Fontes ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --font-prayer: 'Crimson Text', Georgia, 'Times New Roman', serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --overlay-dark: rgba(10, 10, 30, 0.65);
  --overlay-gradient: linear-gradient(
    to bottom,
    rgba(10, 10, 30, 0.88) 0%,
    rgba(10, 10, 30, 0.70) 35%,
    rgba(10, 10, 30, 0.70) 60%,
    rgba(10, 10, 30, 0.92) 100%
  );
  --gold: #d4a843;
  --gold-light: #f0d68a;
  --accent: #8b7ec8;
}

/* ─── Reset & Base ────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: #0a0a1e;
  color: #f0f0f5;
}

/* ─── Background Image ───────────────────────────────── */
#bg-image {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url('../img/bg-default.webp');
  transition: opacity 0.5s ease;
}

#bg-image.bg-transitioning {
  opacity: 0.3;
}

#bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: var(--overlay-gradient);
  pointer-events: none;
}

/* ─── Main Container ─────────────────────────────────── */
.app-container {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ─── Top Bar ────────────────────────────────────────── */
.top-bar {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-home {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f0f0f5;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-right: auto;
}

.btn-home:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-home:active {
  transform: scale(0.93);
}

.top-bar select {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f0f0f5;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-family: var(--font-ui);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.2s;
}

.top-bar select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.25);
}

.top-bar select option {
  background: #1a1a2e;
  color: #f0f0f5;
}

/* ─── Start Screen ───────────────────────────────────── */
.screen-start {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 1.5rem;
}

.app-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  box-shadow: 0 4px 24px rgba(212, 168, 67, 0.35);
  margin-bottom: 0.5rem;
}

.screen-start h1 {
  font-family: var(--font-prayer);
  font-size: 2.4rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.today-info {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 0.25rem;
}

.mystery-group-name {
  font-family: var(--font-prayer);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gold-light);
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}

.mystery-change {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.mystery-change label {
  font-size: 0.78rem;
  opacity: 0.6;
}

.mystery-change select {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f0f0f5;
  border-radius: 8px;
  padding: 0.4rem 1rem;
  font-size: 0.88rem;
  font-family: var(--font-ui);
  cursor: pointer;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.2s;
}

.mystery-change select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--gold);
}

.mystery-change select option {
  background: #1a1a2e;
  color: #f0f0f5;
}

.btn-start {
  background: linear-gradient(135deg, var(--gold), #c09230);
  border: none;
  color: #1a1a1a;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1.1rem;
  padding: 0.85rem 2.5rem;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.4);
  margin-top: 0.5rem;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(212, 168, 67, 0.55);
}

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

/* ─── Resume Section ─────────────────────────────────── */
.resume-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 320px;
}

.resume-info {
  font-size: 0.8rem;
  opacity: 0.6;
  text-align: center;
}

.btn-resume {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f0f0f5;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-resume:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ─── About Section (SEO) ────────────────────────────── */
.about-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  width: 100%;
  max-width: 400px;
}

.about-section h2 {
  font-family: var(--font-ui);
  font-size: 1rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.about-section p {
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0.8;
  margin-bottom: 0;
}

/* ─── Prayer Screen ──────────────────────────────────── */
.screen-prayer {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Progress (custom, não depende do Bootstrap) */
.progress-area {
  padding: 0.5rem 1rem 0.25rem;
  flex-shrink: 0;
}

.progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.4s ease;
  min-height: 4px;
}

.progress-text {
  font-size: 0.72rem;
  opacity: 0.5;
  text-align: right;
  margin-top: 0.15rem;
}

/* Prayer Content */
.prayer-content-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.5rem 1.25rem 1rem;
  -webkit-overflow-scrolling: touch;
}

#prayer-content {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

/* Animations */
.slide-out-left {
  animation: slideOutLeft 0.25s ease-in forwards;
}
.slide-out-right {
  animation: slideOutRight 0.25s ease-in forwards;
}
.slide-in-right {
  animation: slideInRight 0.3s ease-out forwards;
}
.slide-in-left {
  animation: slideInLeft 0.3s ease-out forwards;
}

@keyframes slideOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-40px); }
}
@keyframes slideOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(40px); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}

#decade-info {
  font-size: 0.78rem;
  font-family: var(--font-ui);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

#bead-badge {
  display: inline-block;
  background: rgba(212, 168, 67, 0.2);
  border: 1px solid rgba(212, 168, 67, 0.4);
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.3rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

#prayer-title {
  font-family: var(--font-prayer);
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  line-height: 1.2;
}

#prayer-subtitle {
  font-family: var(--font-prayer);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--gold-light);
  margin-bottom: 1rem;
  opacity: 0.9;
}

#prayer-text {
  font-family: var(--font-prayer);
  font-size: 1.2rem;
  line-height: 1.75;
  color: rgba(240, 240, 245, 0.92);
  white-space: pre-line;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
  max-width: 520px;
  margin: 0 auto;
}

/* ─── Navigation Buttons ─────────────────────────────── */
.nav-buttons {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.btn-nav {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
}

.btn-nav:active {
  transform: scale(0.97);
}

.btn-pray-again:active {
  transform: scale(0.95);
}

/* ─── Support Section (Monetization) ─────────────────── */
.support-area {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.support-title {
  font-size: 0.9rem;
  opacity: 0.7;
}

.support-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-support {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f0f0f5;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-support:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--gold);
}

.btn-support.btn-donate {
  background: rgba(212, 168, 67, 0.1);
  border-color: rgba(212, 168, 67, 0.3);
}

.btn-support.btn-donate:hover {
  background: rgba(212, 168, 67, 0.2);
}

/* Modal Simple Simulation */
.support-feedback {
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid var(--gold);
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-top: 1rem;
  width: 100%;
  text-align: center;
}

.btn-prev {
  background: rgba(255, 255, 255, 0.12);
  color: #f0f0f5;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex: 0.6;
}

.btn-prev:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.btn-prev:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-next {
  background: linear-gradient(135deg, var(--gold), #c09230);
  color: #1a1a1a;
  flex: 1;
  box-shadow: 0 2px 12px rgba(212, 168, 67, 0.3);
}

.btn-next:hover {
  box-shadow: 0 4px 20px rgba(212, 168, 67, 0.5);
}

/* ─── Complete Screen ────────────────────────────────── */
.screen-complete {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  gap: 1.5rem;
}

.complete-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: 0 4px 24px rgba(76, 175, 80, 0.35);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 24px rgba(76, 175, 80, 0.35); }
  50%      { box-shadow: 0 4px 36px rgba(76, 175, 80, 0.55); }
}

.screen-complete h2 {
  font-family: var(--font-prayer);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.screen-complete p {
  font-family: var(--font-prayer);
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(240, 240, 245, 0.8);
  max-width: 400px;
}

.btn-pray-again {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f0f0f5;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.btn-pray-again:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

/* ─── Responsive ─────────────────────────────────────── */
@media (min-width: 768px) {
  #prayer-title {
    font-size: 2.2rem;
  }
  #prayer-text {
    font-size: 1.35rem;
  }
  .screen-start h1 {
    font-size: 3rem;
  }
}

@media (max-height: 600px) {
  .screen-start {
    gap: 0.75rem;
    padding: 1rem;
  }
  .app-logo {
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
  }
  .screen-start h1 {
    font-size: 1.8rem;
  }
  #prayer-title {
    font-size: 1.5rem;
  }
  #prayer-text {
    font-size: 1.05rem;
  }
}

/* ─── Scrollbar ──────────────────────────────────────── */
.prayer-content-wrapper::-webkit-scrollbar {
  width: 4px;
}
.prayer-content-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.prayer-content-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

/* ─── Utility ────────────────────────────────────────── */
.d-none {
  display: none !important;
}
