/* ========================================
   ORA Y BENDICE - STYLES
   IASD Emmanuel - Dpto. de Jóvenes
   ======================================== */

/* CSS Variables */
:root {
  /* Viewport Height Fix */
  --vh: 1vh; /* Valor por defecto para fallback */

  /* Brand Colors */
  --primary: #3E8391;
  --primary-light: rgba(62, 131, 145, 0.02);
  --primary-border: rgba(62, 131, 145, 0.45);
  --primary-text: rgba(62, 131, 145, 0.65);

  --accent: #FFA92D;
  --accent-light: #FFE2B8;

  /* Background */
  --bg-main: #FDF9F3;
  --bg-white: #FFFFFF;

  /* Text Colors */
  --text-strong: #000000;
  --text-base: rgba(52, 52, 52, 0.60);
  --text-weak: rgba(0, 8.50, 51, 0.65);

  /* Borders & Strokes */
  --stroke-base: rgba(52, 52, 52, 0.60);
  --stroke-weak: rgba(0, 17, 102, 0.10);

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-secondary: 'Noto Sans', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --font-display: 'Advent Pro', sans-serif;
}

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

/* Base */
body {
  font-family: var(--font-secondary);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-strong);
  background: var(--bg-main);
  min-height: 100vh;
  min-height: 100dvh;
  min-height: calc(var(--vh, 1vh) * 100);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* App Container */
.app-container {
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for modern browsers */
  min-height: calc(var(--vh, 1vh) * 100); /* Fallback with JS */
  position: relative;
  background: var(--bg-main);
}

/* Screen Layout */
.screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
}

/* Selection Screen - No scroll, fit to viewport */
#selectionScreen {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: calc(var(--vh, 1vh) * 100);
  max-height: 100vh;
  max-height: 100dvh;
  max-height: calc(var(--vh, 1vh) * 100);
  overflow-y: hidden;
}

/* Bottom Section Container */
.bottom-section {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#selectionScreen .footer-credits {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 16px;
}

#selectionScreen .church-badge {
  position: relative;
  bottom: auto;
  left: auto;
  transform: none;
  margin: 0;
}

/* Result Screens - No scroll needed, all content fits */
#resultScreen,
#welcomeBackScreen {
  overflow-y: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: calc(var(--vh, 1vh) * 100);
  max-height: 100vh;
  max-height: 100dvh;
  max-height: calc(var(--vh, 1vh) * 100);
}


/* Church Badge */
.church-badge {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  padding: 8px 14px 8px 12px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 20px;
  backdrop-filter: blur(5.26px);
  max-width: 85%;
  z-index: 10;
}

.church-badge img {
  width: auto;
  height: 40px;
  max-width: 100%;
  object-fit: contain;
}

/* Church Badge Small (Result Screen) */
.church-badge-small {
  position: relative;
  margin: 24px auto 0;
  padding: 8px 12px;
  border-radius: 16px;
  backdrop-filter: blur(3.54px);
  display: flex;
  width: fit-content;
  max-width: 90%;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.church-badge-small img {
  width: auto;
  height: 33.08px;
  max-width: 100%;
  object-fit: contain;
}

/* App Logo Section */
.app-logo-section {
  display: inline-flex;
  width: 222.27px;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 12vh;
}

.logo-graphics {
  width: 80px;
  height: 80px;
  position: relative;
}

.logo-graphics img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.app-title {
  align-self: stretch;
  color: black;
  text-align: center;
  font-family: 'Advent Pro', var(--font-display);
  font-size: 24px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  word-wrap: break-word;
}

.app-tagline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-strong);
  text-align: center;
  font-family: var(--font-secondary);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  margin: 0;
  white-space: nowrap;
}

.tag-icon {
  display: flex;
  padding: 4px;
  justify-content: flex-start;
  align-items: center;
  gap: 7.08px;
  transform: rotate(-9deg);
  border-radius: 8px;
  border: 1px solid #FFA92D;
  background: #FFE2B8;
  flex-shrink: 0;
}

.tag-icon.praying {
  transform: rotate(-9.104deg);
}

.tag-icon.blessing {
  transform: rotate(10deg);
}

.tag-icon img {
  width: 23.92px;
  height: 23.92px;
  object-fit: contain;
}

/* Form Section */
.form-section {
  position: absolute;
  top: 42vh;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 330px;
  display: inline-flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Select Wrapper */
.select-wrapper {
  position: relative;
  width: 100%;
}

.form-select {
  display: inline-flex;
  height: 48px;
  padding: 0 48px 0 16px;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  width: 100%;
  border-radius: 80px;
  border: 1px solid rgba(52, 52, 52, 0.60);
  background: #FFF;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-strong);
  appearance: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-select:focus {
  border-color: var(--primary);
}

.select-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: rgba(52, 52, 52, 0.60);
  font-size: 16px;
}

/* Buttons */
.btn {
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 80px;
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.3s ease;
}

.btn-primary {
  display: inline-flex;
  height: 48px;
  padding: 0 16px;
  justify-content: center;
  align-items: center;
  border-radius: 80px;
  background: #3E8391;
  box-shadow: 0px 4px 8px -2px rgba(0, 0, 0, 0.04);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px -2px rgba(0, 0, 0, 0.12), 0 8px 16px -2px rgba(0, 0, 0, 0.08);
}

.btn-admin {
  display: flex;
  height: 32px;
  padding: 0 12px;
  justify-content: center;
  align-items: center;
  gap: 0;
  border-radius: 80px;
  border: 1px solid #FFA92D;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-admin i {
  font-size: 16px;
  color: #FFA92D;
  opacity: 0.8;
  width: 16px;
  height: 16px;
}

.btn-admin span {
  color: #FFA92D;
  font-family: 'Inter', var(--font-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  padding: 0 4px;
}

.btn-admin:hover {
  background: #FFF9ED;
}

.btn-back {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  background: var(--bg-white);
  border: 1px solid var(--stroke-weak);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-back:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

/* Form Footer */
.form-footer {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.help-text {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
}

.text-weak {
  color: var(--text-weak);
}

.link-underline {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}

.divider {
  height: 1px;
  background: var(--stroke-weak);
}

.disclaimer {
  font-size: 14px;
  color: var(--text-weak);
  line-height: 20px;
}

/* Footer Credits */
.footer-credits {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  padding: 16px 16px 24px;
  margin: 0;
  flex-shrink: 0;
  background: var(--bg-main);
}

.credit-text {
  color: #FFA92D;
  text-align: center;
  font-family: "Noto Sans";
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  text-decoration: underline;
  white-space: nowrap;
  opacity: 0.6;
}

.credit-text:hover {
  opacity: 0.8;
}

/* Welcome Back Screen */
.welcome-section {
  width: 90%;
  max-width: 330px;
  margin: 32px auto 0;
  padding-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex-shrink: 0;
}

.welcome-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.welcome-title {
  align-self: stretch;
  font-family: 'Advent Pro', var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: black;
  text-align: center;
  word-wrap: break-word;
  margin: 0;
}

.welcome-user {
  align-self: stretch;
  font-family: 'Advent Pro', var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: black;
  text-align: center;
  word-wrap: break-word;
  margin: 0;
}



.welcome-request {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Result Screen */
.result-section {
  width: 90%;
  max-width: 330px;
  margin: 32px auto 0;
  padding-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  flex-shrink: 0;
}

.result-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.result-header-group {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.user-name {
  align-self: stretch;
  font-family: 'Advent Pro', var(--font-display);
  font-size: 24px;
  font-weight: 400;
  color: black;
  text-align: center;
  word-wrap: break-word;
  margin: 0;
}

.result-subtitle {
  align-self: stretch;
  font-size: 14px;
  color: var(--text-weak);
  text-align: center;
  line-height: 20px;
  font-family: 'Noto Sans';
  font-weight: 400;
  word-wrap: break-word;
  margin: 0;
}

.result-box {
  align-self: stretch;
  padding: 24px 32px;
  background: rgba(62, 131, 145, 0.02);
  border: 1px solid rgba(62, 131, 145, 0.45);
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.result-name {
  align-self: stretch;
  font-family: 'Roboto Mono', var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  color: rgba(62, 131, 145, 0.65);
  text-align: center;
  line-height: 21px;
  word-wrap: break-word;
}

.result-content {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.reminder-text {
  align-self: stretch;
  font-size: 14px;
  font-family: 'Noto Sans';
  font-weight: 400;
  color: var(--text-weak);
  text-align: center;
  line-height: 20px;
  word-wrap: break-word;
}

.prayer-request-section {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.request-label {
  align-self: stretch;
  font-size: 14px;
  font-family: 'Noto Sans';
  font-weight: 400;
  color: var(--text-weak);
  text-align: center;
  line-height: 20px;
  word-wrap: break-word;
  margin: 0 0 8px 0;
}

.request-box {
  align-self: stretch;
  padding: 24px 32px;
  background: rgba(62, 131, 145, 0.02);
  border: 1px solid rgba(62, 131, 145, 0.45);
  border-radius: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  max-height: 150px;
}

.request-box p {
  align-self: stretch;
  font-family: 'Roboto Mono', var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  color: rgba(62, 131, 145, 0.65);
  text-align: center;
  line-height: 21px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  margin: 0;
}

/* App Logo Bottom */
.app-logo-bottom {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 auto 16px;
  flex-shrink: 0;
}

.logo-graphics-small {
  width: 40px;
  height: 40px;
  position: relative;
  flex-shrink: 0;
}

.logo-graphics-small img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.app-title-small {
  color: black;
  text-align: center;
  font-family: 'Advent Pro', var(--font-display);
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  word-wrap: break-word;
  white-space: nowrap;
}

/* Admin Panel */
.admin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.admin-panel {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  background: var(--bg-white);
  border-radius: 24px;
  overflow-y: auto;
}

.admin-header {
  padding: 20px;
  border-bottom: 1px solid var(--stroke-weak);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-strong);
}

.btn-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.btn-close:hover {
  background: var(--primary-light);
}

.admin-content {
  padding: 20px;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--stroke-weak);
  padding-bottom: 10px;
}

.tab {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-weak);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color 0.3s ease;
}

.tab.active {
  color: var(--primary);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
}

.tab-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.add-participant {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.add-participant input {
  padding: 12px 16px;
  border: 1px solid var(--stroke-weak);
  border-radius: 12px;
  font-size: 14px;
}

.btn-success {
  background: #27AE60;
  color: white;
}

.btn-warning {
  background: var(--accent);
  color: white;
}

.btn-danger {
  background: #E74C3C;
  color: white;
}

.participants-list,
.assignments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Registration Summary */
.registration-summary {
  background: linear-gradient(135deg, rgba(62, 131, 145, 0.08) 0%, rgba(62, 131, 145, 0.04) 100%);
  border: 1px solid var(--primary-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.summary-label {
  font-family: 'Noto Sans';
  font-size: 14px;
  color: var(--text-weak);
}

.summary-value {
  font-family: 'Roboto Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
}

.summary-value.registered {
  color: #4CAF50;
}

.summary-value.pending {
  color: #FF9800;
}

.firebase-warning {
  background: #FFF3CD;
  border: 1px solid #FFC107;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: #856404;
  margin-bottom: 12px;
}

.firebase-warning a {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 600;
}

.summary-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--primary-border);
  font-size: 12px;
  color: var(--text-weak);
  font-style: italic;
}

.participant-item,
.assignment-item {
  padding: 12px;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Status Indicator */
.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.status-indicator.selected {
  background-color: #4CAF50;
  box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
}

.status-indicator.pending {
  background-color: #ddd;
  border: 1px solid #999;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-group label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
}

.settings-group input {
  padding: 12px 16px;
  border: 1px solid var(--stroke-weak);
  border-radius: 12px;
  font-size: 14px;
}

.danger-zone {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--stroke-weak);
}

.danger-zone h4 {
  color: #E74C3C;
  font-size: 16px;
  margin-bottom: 12px;
}

.btn-control-small {
  width: 32px;
  height: 32px;
  background: var(--bg-white);
  border: 1px solid var(--stroke-weak);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-base);
}

.btn-control-small:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Responsive - Keep mobile sizes for smaller screens */
@media (max-width: 420px) {
  .church-badge {
    bottom: 60px;
  }

  .church-badge img {
    height: 45px;
  }

  .logo-graphics {
    width: 70px;
    height: 70px;
  }

  .logo-graphics img {
    width: 70px;
    height: 70px;
  }

  .app-title {
    font-size: 22px;
  }

  .app-tagline {
    font-size: 13px;
  }

  .form-section {
    top: 40vh;
  }
}

@media (max-height: 700px) {
  .app-logo-section {
    top: 8vh;
  }

  .logo-graphics {
    width: 60px;
    height: 60px;
  }

  .logo-graphics img {
    width: 60px;
    height: 60px;
  }

  .church-badge {
    bottom: 60px;
  }

  .church-badge img {
    height: 40px;
  }

  .form-section {
    top: 38vh;
    gap: 16px;
  }

  .app-title {
    font-size: 20px;
  }

  .app-tagline {
    font-size: 12px;
  }

  .footer-credits {
    bottom: 12px;
  }
}

/* ========================================
   Views Tab
   ======================================== */
.views-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.views-list .btn {
  justify-content: flex-start;
  text-align: left;
}

.views-list .btn i {
  margin-right: 12px;
  font-size: 18px;
}