/* ================================================================
   Yükselen Burç Hesaplama — Frontend Stilleri
   Mobile-first, CSS değişkeni tabanlı, dark mode destekli
   ================================================================ */

:root {
  --ybh-primary:      #6c3b8e;
  --ybh-primary-dark: #4a2566;
  --ybh-bg:           #ffffff;
  --ybh-surface:      #f8f4fc;
  --ybh-border:       #e0d0f0;
  --ybh-text:         #1a1a2e;
  --ybh-text-muted:   #6b6b8a;
  --ybh-success:      #2d7a3a;
  --ybh-error:        #c0392b;
  --ybh-warn:         #8b6914;
  --ybh-warn-bg:      #fef9e7;
  --ybh-radius:       12px;
  --ybh-shadow:       0 4px 24px rgba(108,59,142,.12);
  --ybh-font:         inherit;
}

[data-theme="koyu"],
.ybh-wrap[data-theme="koyu"] {
  --ybh-bg:         #1a1a2e;
  --ybh-surface:    #16213e;
  --ybh-border:     #2d2d5a;
  --ybh-text:       #e8e4f0;
  --ybh-text-muted: #9090b8;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"],
  .ybh-wrap[data-theme="auto"] {
    --ybh-bg:         #1a1a2e;
    --ybh-surface:    #16213e;
    --ybh-border:     #2d2d5a;
    --ybh-text:       #e8e4f0;
    --ybh-text-muted: #9090b8;
  }
}

/* ----------------------------------------------------------------
   Kapsayıcı
   ---------------------------------------------------------------- */
.ybh-wrap {
  font-family: var(--ybh-font);
  color: var(--ybh-text);
  background: var(--ybh-bg);
  border: 1px solid var(--ybh-border);
  border-radius: var(--ybh-radius);
  padding: 1.5rem;
  box-shadow: var(--ybh-shadow);
  max-width: 560px;
  margin: 1.5rem auto;
  box-sizing: border-box;
}

.ybh-title {
  font-size: 1.4rem;
  color: var(--ybh-primary);
  text-align: center;
  margin: 0 0 1.25rem;
}

/* ----------------------------------------------------------------
   İlerleme göstergesi
   ---------------------------------------------------------------- */
.ybh-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  position: relative;
}

.ybh-progress::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--ybh-border);
  z-index: 0;
}

.ybh-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  z-index: 1;
}

.ybh-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ybh-surface);
  border: 2px solid var(--ybh-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  color: var(--ybh-text-muted);
  transition: background .25s, border-color .25s, color .25s;
}

.ybh-progress-step.active .ybh-step-num,
.ybh-progress-step.done .ybh-step-num {
  background: var(--ybh-primary);
  border-color: var(--ybh-primary);
  color: #fff;
}

.ybh-step-label {
  font-size: .7rem;
  color: var(--ybh-text-muted);
  margin-top: .3rem;
  text-align: center;
}

.ybh-progress-step.active .ybh-step-label {
  color: var(--ybh-primary);
  font-weight: 600;
}

/* ----------------------------------------------------------------
   Form adımları
   ---------------------------------------------------------------- */
.ybh-step {
  border: none;
  padding: 0;
  margin: 0;
}

.ybh-step[hidden] {
  display: none;
}

.ybh-step-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ybh-text);
  margin: 0 0 1.25rem;
  padding: 0;
}

.ybh-field {
  margin-bottom: 1rem;
}

.ybh-field label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ybh-text-muted);
  margin-bottom: .35rem;
}

.ybh-field select,
.ybh-field input[type="text"],
.ybh-field input[type="email"],
.ybh-field input[type="url"] {
  width: 100%;
  padding: .65rem .85rem;
  border: 1.5px solid var(--ybh-border);
  border-radius: 8px;
  background: var(--ybh-surface);
  color: var(--ybh-text);
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color .2s;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
}

.ybh-field select:focus,
.ybh-field input:focus {
  outline: none;
  border-color: var(--ybh-primary);
  box-shadow: 0 0 0 3px rgba(108,59,142,.18);
}

.ybh-field select[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

/* Tarih grubu */
.ybh-date-group {
  display: grid;
  grid-template-columns: 1fr 2fr 1.5fr;
  gap: .75rem;
}

/* Saat grubu */
.ybh-time-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}

/* ----------------------------------------------------------------
   Checkbox alanı
   ---------------------------------------------------------------- */
.ybh-checkbox-field label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .9rem;
  color: var(--ybh-text);
  font-weight: normal;
}

.ybh-checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--ybh-primary);
  cursor: pointer;
}

.ybh-approx-info {
  color: var(--ybh-primary);
  text-decoration: none;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   Konum
   ---------------------------------------------------------------- */
.ybh-location-toggle {
  display: flex;
  gap: .5rem;
  margin-bottom: 1rem;
  background: var(--ybh-surface);
  border-radius: 8px;
  padding: .25rem;
}

.ybh-toggle-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ybh-text-muted);
  transition: background .2s, color .2s;
}

.ybh-toggle-option input { display: none; }

.ybh-toggle-option:has(input:checked),
.ybh-toggle-active {
  background: var(--ybh-primary);
  color: #fff;
}

/* Autocomplete */
.ybh-autocomplete-wrap { position: relative; }

.ybh-autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--ybh-bg);
  border: 1.5px solid var(--ybh-border);
  border-radius: 8px;
  list-style: none;
  margin: 0;
  padding: .25rem 0;
  z-index: 100;
  box-shadow: var(--ybh-shadow);
  max-height: 240px;
  overflow-y: auto;
}

.ybh-autocomplete-list[hidden] { display: none; }

.ybh-autocomplete-list li {
  padding: .6rem 1rem;
  cursor: pointer;
  font-size: .875rem;
  line-height: 1.4;
  color: var(--ybh-text);
}

.ybh-autocomplete-list li:hover,
.ybh-autocomplete-list li[aria-selected="true"] {
  background: var(--ybh-surface);
}

/* ----------------------------------------------------------------
   Onay (KVKK)
   ---------------------------------------------------------------- */
.ybh-consent-field {
  background: var(--ybh-surface);
  border-left: 3px solid var(--ybh-primary);
  border-radius: 0 8px 8px 0;
  padding: .85rem;
}

.ybh-consent-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: .6rem;
  cursor: pointer;
  font-weight: normal !important;
}

.ybh-consent-text {
  font-size: .85rem;
  color: var(--ybh-text);
  line-height: 1.5;
}

.ybh-consent-text a {
  color: var(--ybh-primary);
}

/* ----------------------------------------------------------------
   Butonlar
   ---------------------------------------------------------------- */
.ybh-step-nav {
  display: flex;
  gap: .75rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
}

.ybh-btn {
  padding: .7rem 1.4rem;
  border-radius: 8px;
  border: none;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .1s;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.ybh-btn:active { transform: scale(.97); }

.ybh-btn-next,
.ybh-btn-submit {
  background: var(--ybh-primary);
  color: #fff;
}

.ybh-btn-next:hover,
.ybh-btn-submit:hover {
  background: var(--ybh-primary-dark);
}

.ybh-btn-prev {
  background: var(--ybh-surface);
  color: var(--ybh-text);
  border: 1.5px solid var(--ybh-border);
}

.ybh-btn-prev:hover {
  background: var(--ybh-border);
}

.ybh-btn-submit[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* ----------------------------------------------------------------
   Hata mesajları
   ---------------------------------------------------------------- */
.ybh-error-msg {
  font-size: .85rem;
  color: var(--ybh-error);
  margin-top: .35rem;
  min-height: 1.2em;
}

.ybh-noscript-warn {
  background: var(--ybh-warn-bg);
  color: var(--ybh-warn);
  padding: .75rem 1rem;
  border-radius: 8px;
  font-size: .9rem;
  border: 1px solid var(--ybh-border);
}

/* ----------------------------------------------------------------
   Sonuç Kartı
   ---------------------------------------------------------------- */
.ybh-result {
  animation: ybhFadeIn .4s ease;
}

.ybh-result[hidden] { display: none; }

@keyframes ybhFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.ybh-result-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.ybh-result-greeting {
  display: block;
  color: var(--ybh-text-muted);
  font-size: .95rem;
  margin-bottom: .6rem;
}

.ybh-result-sign-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.ybh-result-symbol {
  font-size: 3.5rem;
  line-height: 1;
}

.ybh-result-sign {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ybh-primary);
  margin: 0 0 .2rem;
}

.ybh-result-degree {
  font-size: .95rem;
  color: var(--ybh-text-muted);
  margin: 0;
}

.ybh-result-description {
  line-height: 1.7;
  color: var(--ybh-text);
  background: var(--ybh-surface);
  border-radius: 8px;
  padding: 1rem;
  font-size: .95rem;
}

.ybh-result-details {
  margin: 1rem 0;
  font-size: .85rem;
}

.ybh-result-details summary {
  cursor: pointer;
  color: var(--ybh-text-muted);
  font-weight: 600;
}

.ybh-result-detail-list {
  list-style: none;
  padding: .5rem 0 0;
  margin: 0;
}

.ybh-result-detail-list li {
  display: flex;
  gap: .5rem;
  padding: .2rem 0;
  color: var(--ybh-text-muted);
}

.ybh-result-detail-list li strong {
  color: var(--ybh-text);
  min-width: 140px;
}

/* Uyarı kutusu */
.ybh-approx-warn {
  background: var(--ybh-warn-bg);
  border-left: 4px solid #e6ac00;
  border-radius: 0 8px 8px 0;
  padding: .85rem 1rem;
  margin: 1rem 0;
  font-size: .875rem;
  color: var(--ybh-warn);
}

.ybh-approx-warn[hidden] { display: none; }

.ybh-possible-signs {
  list-style: none;
  padding: 0;
  margin: .5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.ybh-possible-signs li {
  background: rgba(230,172,0,.15);
  border-radius: 6px;
  padding: .25rem .6rem;
  font-weight: 600;
}

/* Aksiyon butonları */
.ybh-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 1.25rem 0 .75rem;
}

.ybh-btn-share  { background: var(--ybh-surface); color: var(--ybh-text); border: 1.5px solid var(--ybh-border); }
.ybh-btn-cta    { background: var(--ybh-primary); color: #fff; }
.ybh-btn-reset  { background: var(--ybh-surface); color: var(--ybh-text-muted); border: 1.5px solid var(--ybh-border); font-size: .85rem; }

.ybh-disclaimer {
  font-size: .78rem;
  color: var(--ybh-text-muted);
  text-align: center;
  font-style: italic;
}

/* Debug */
.ybh-debug-info[hidden] { display: none; }
.ybh-debug-pre { font-size: .75rem; overflow-x: auto; background: var(--ybh-surface); padding: .75rem; border-radius: 6px; }

/* ----------------------------------------------------------------
   Modal
   ---------------------------------------------------------------- */
.ybh-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ybh-modal[hidden] { display: none; }

.ybh-modal-inner {
  background: var(--ybh-bg);
  border-radius: var(--ybh-radius);
  padding: 1.75rem;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,.3);
}

.ybh-modal-close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--ybh-text-muted);
  min-width: 44px;
  min-height: 44px;
}

.ybh-modal-inner h3 { margin-top: 0; color: var(--ybh-primary); }

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
  .ybh-wrap { padding: 1rem; margin: 1rem; border-radius: 8px; }
  .ybh-date-group { grid-template-columns: 1fr 1fr; }
  .ybh-date-group .ybh-field:last-child { grid-column: 1 / -1; }
  .ybh-result-sign-wrap { flex-direction: column; gap: .5rem; }
  .ybh-result-symbol { font-size: 2.5rem; }
  .ybh-result-sign { font-size: 1.6rem; }
  .ybh-result-actions { flex-direction: column; }
  .ybh-step-nav { flex-direction: column-reverse; }
  .ybh-btn { justify-content: center; width: 100%; }
  .ybh-result-detail-list li { flex-direction: column; }
  .ybh-result-detail-list li strong { min-width: unset; }
}
