/* ══════════════════════════════════════
   TORA TALEP - Frontend Styles
   ══════════════════════════════════════ */

/* ── Reset within scope ── */
.tora-form *, .tora-form *::before, .tora-form *::after,
.tora-modal-overlay *, .tora-sticky-bar * { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Modal Overlay ── */
.tora-modal-overlay {
  position: fixed; inset: 0; z-index: 999999;
  background: rgba(0,0,0,0.55);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.tora-modal-overlay.tora-open { display: flex; }
body.tora-modal-open { 
  overflow: hidden !important; 
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

.tora-modal {
  background: #fff; border-radius: 24px;
  width: 100%; max-width: 500px;
  max-height: 90vh; max-height: 90dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -ms-overflow-style: none; /* IE/Edge */
  scrollbar-width: none; /* Firefox */
  padding: 36px 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: toraSlideUp .3s ease;
  overscroll-behavior: contain;
}
.tora-modal::-webkit-scrollbar { display: none; /* Chrome/Safari */ }
@keyframes toraSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Close button removed - users must complete form or click outside */

/* ── Inline (shortcode) ── */
.tora-talep-inline .tora-form {
  max-width: 500px; margin: 0 auto;
  background: #fff; border-radius: 24px;
  padding: 36px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);
}

/* ── Header ── */
.tora-header { text-align: center; margin-bottom: 24px; }
.tora-title {
  font-size: 22px !important; font-weight: 800 !important;
  color: #0f172a !important; letter-spacing: -0.5px;
  line-height: 1.3 !important; margin: 0 !important; padding: 0 !important;
}

/* ── Steps ── */
.tora-steps {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px; gap: 0;
}
.tora-dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0; transition: all .3s;
}
.tora-dot-active  { background: linear-gradient(135deg, #2563eb, #0ea5e9); color: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,0.15); }
.tora-dot-done    { background: #22c55e; color: #fff; }
.tora-dot-pending { background: #e2e8f0; color: #94a3b8; }
.tora-line { flex: 1; height: 2px; background: #e2e8f0; max-width: 56px; transition: background .3s; }
.tora-line-done { background: #22c55e; }

/* ── Form ── */
.tora-step-title {
  font-size: 18px !important; font-weight: 800 !important;
  color: #0f172a !important; margin-bottom: 18px !important;
}
.tora-field { margin-bottom: 14px; }
.tora-field label {
  display: block !important; font-size: 11px !important;
  font-weight: 700 !important; color: #64748b !important;
  margin-bottom: 7px !important; letter-spacing: 0.6px;
  text-transform: uppercase;
}
.tora-form input[type=text],
.tora-form input[type=tel] {
  width: 100% !important; background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important; border-radius: 12px !important;
  padding: 13px 16px !important; font-size: 16px !important;
  color: #0f172a !important; outline: none !important;
  transition: border-color .2s, box-shadow .2s !important;
  font-family: inherit !important;
  -webkit-appearance: none !important; appearance: none !important;
}
.tora-form input::placeholder { color: #64748b !important; }
.tora-form input:focus {
  border-color: #2563eb !important; background: #fff !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10) !important;
}

/* ── Select ── */
.tora-form select {
  width: 100% !important; background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important; border-radius: 12px !important;
  padding: 12px 36px 12px 14px !important; font-size: 16px !important;
  color: #0f172a !important; outline: none !important;
  font-family: inherit !important; cursor: pointer;
  -webkit-appearance: none !important; appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  transition: border-color .2s, box-shadow .2s !important;
}
.tora-form select:focus {
  border-color: #2563eb !important; background-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10) !important;
}
.tora-form select:disabled { opacity: .5; cursor: not-allowed; }

.tora-il-row { display: flex; gap: 10px; }
.tora-il-row > * { flex: 1; min-width: 120px; }
.tora-il-row select { 
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* ── Input with button ── */
.tora-input-with-btn {
  display: flex; gap: 8px;
}
.tora-input-with-btn input {
  flex: 1; min-width: 0;
}
.tora-input-btn {
  flex-shrink: 0; padding: 12px 20px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff; border: none; border-radius: 12px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  transition: all .2s;
}
.tora-input-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.tora-input-btn:active { transform: translateY(0); }

/* ── Divider ── */
.tora-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: #94a3b8; font-size: 12px; font-weight: 600;
}
.tora-divider::before, .tora-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

/* ── Collapse ── */
.tora-collapse { margin-bottom: 14px; }
.tora-collapse-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #f8fafc; border: 1.5px solid #e2e8f0;
  border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600;
  color: #475569; transition: all .2s; font-family: inherit;
}
.tora-collapse-toggle:hover { background: #f1f5f9; border-color: #cbd5e1; }
.tora-collapse-toggle.tora-open { border-radius: 12px 12px 0 0; border-bottom-color: transparent; background: #fff; }
.tora-collapse-icon { transition: transform .2s; color: #94a3b8; }
.tora-collapse-toggle.tora-open .tora-collapse-icon { transform: rotate(180deg); }
.tora-collapse-content {
  padding: 16px; background: #fff; border: 1.5px solid #e2e8f0;
  border-top: none; border-radius: 0 0 12px 12px;
}
.tora-collapse-content .tora-il-row { margin-bottom: 10px; }

/* ── Search results (ünvan - scrollable) ── */
.tora-sr-list {
  margin-top: 6px; border: 1.5px solid #e2e8f0; border-radius: 12px;
  overflow-y: auto; max-height: 156px; background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.tora-sr-list::-webkit-scrollbar { width: 4px; }
.tora-sr-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ── Multi list (max 2 items visible, scroll) ── */
.tora-multi-list {
  margin-top: 10px; border: 1.5px solid #e2e8f0; border-radius: 12px;
  overflow-y: auto; overflow-x: hidden;
  max-height: 180px; /* ~2 items */
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.tora-multi-list::-webkit-scrollbar { width: 4px; }
.tora-multi-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ── List items (shared) ── */
.tora-list-item {
  padding: 13px 16px; cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.tora-list-item:last-child { border-bottom: none; }
.tora-list-item:hover, .tora-list-item:active { background: #eff6ff; }
.tora-list-item-name { font-size: 13px; font-weight: 600; color: #0f172a; line-height: 1.4; }
.tora-list-item-meta { font-size: 11px; color: #94a3b8; margin-top: 3px; }

.tora-list-header {
  font-size: 12px; font-weight: 700; color: #2563eb;
  padding: 10px 14px 6px; letter-spacing: 0.3px;
  border-bottom: 1px solid #f1f5f9;
}
.tora-list-empty  { padding: 14px 16px; font-size: 13px; color: #94a3b8; text-align: center; }
.tora-list-loading { padding: 14px 16px; font-size: 13px; color: #64748b; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ── Station card ── */
.tora-station {
  background: #eff6ff; border: 1.5px solid #bfdbfe;
  border-radius: 14px; padding: 16px 18px; margin-bottom: 14px;
}
.tora-station-label  { font-size: 10px; font-weight: 800; color: #2563eb; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; }
.tora-station-unvan  { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 3px; line-height: 1.4; }
.tora-station-lisans { font-size: 12px; color: #64748b; font-family: monospace; }
.tora-station-adres  { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.tora-station-dagitim { font-size: 12px; color: #64748b; margin-top: 3px; }

/* ── Alert ── */
.tora-alert {
  border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.6; font-weight: 500;
}
.tora-alert-error { background: #fef2f2; border: 1.5px solid #fecaca; color: #dc2626; }

/* ── Buttons ── */
.tora-btn {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all .2s; margin-top: 6px; font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.tora-btn-primary { background: linear-gradient(135deg, #2563eb, #0ea5e9); color: #fff; box-shadow: 0 4px 16px rgba(37,99,235,0.25); }
.tora-btn-primary:hover  { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.35); }
.tora-btn-primary:active { transform: translateY(0); }
.tora-btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.tora-btn-secondary { background: #e0e7ff; color: #3730a3; font-size: 13px; padding: 11px; margin-top: 10px; }
.tora-btn-secondary:hover { background: #c7d2fe; }
.tora-btn-ghost { background: #f1f5f9; color: #64748b; margin-top: 10px; }
.tora-btn-ghost:hover { background: #e2e8f0; }

/* ── Result ── */
.tora-result-icon {
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; margin: 0 auto 20px;
}
.tora-result-ok   { background: #f0fdf4; border: 2px solid #86efac; }
.tora-result-warn { background: #fffbeb; border: 2px solid #fde68a; }
.tora-result-title { text-align: center; font-size: 19px; font-weight: 800; color: #0f172a; margin-bottom: 10px; }
.tora-result-msg   { text-align: center; font-size: 14px; color: #475569; line-height: 1.75; }

/* ── Contact buttons ── */
.tora-contact { display: flex; flex-direction: column; gap: 10px; margin: 20px 0 6px; }
.tora-btn-wa {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 700; font-family: inherit;
  background: #25d366; color: #fff !important;
  box-shadow: 0 4px 14px rgba(37,211,102,0.30);
  text-decoration: none !important; transition: all .2s;
}
.tora-btn-wa:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37,211,102,0.40); color: #fff !important; }
.tora-btn-call {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px; border-radius: 12px; border: 1.5px solid #e2e8f0; cursor: pointer;
  font-size: 15px; font-weight: 700; font-family: inherit;
  background: #f8fafc; color: #0f172a !important;
  text-decoration: none !important; transition: all .2s;
}
.tora-btn-call:hover { background: #f1f5f9; color: #0f172a !important; }

/* ── Spinner ── */
.tora-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: toraSpin .7s linear infinite;
  vertical-align: middle; margin-right: 8px;
}
.tora-spinner-dark {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid #e2e8f0; border-top-color: #2563eb;
  border-radius: 50%; animation: toraSpin .7s linear infinite;
}
@keyframes toraSpin { to { transform: rotate(360deg); } }

.tora-hidden { display: none !important; }

/* ── Sticky Bar ── */
.tora-sticky-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 99999; background: #fff;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  padding: 10px 16px;
  transform: translateY(100%);
  transition: transform .3s ease;
  display: none;
}
.tora-sticky-bar.tora-sticky-show {
  display: block; transform: translateY(0);
}
.tora-sticky-inner {
  max-width: 600px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.tora-sticky-info { flex: 1; min-width: 0; }
.tora-sticky-name { display: block; font-size: 12px; font-weight: 600; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tora-sticky-price { display: block; font-size: 11px; color: #64748b; }
.tora-sticky-btn {
  flex-shrink: 0; padding: 12px 20px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  white-space: nowrap; -webkit-tap-highlight-color: transparent;
}

/* ── Mobile Zoom Prevention ── */
@media (max-width: 768px) {
  .tora-form input[type="text"],
  .tora-form input[type="tel"],
  .tora-form select {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
  }
  
  /* Prevent double-tap zoom */
  .tora-form button,
  .tora-list-item {
    touch-action: manipulation;
  }
}

/* ── Mobile - Full Screen App-like ── */
@media (max-width: 480px) {
  .tora-modal-overlay {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
    background: #fff;
  }
  
  .tora-modal { 
    padding: 24px 20px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    max-height: none;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    max-width: none;
    box-shadow: none;
    animation: toraFadeIn .2s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  @keyframes toraFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  
  .tora-talep-inline .tora-form { padding: 24px 18px; border-radius: 20px; }
  .tora-title { font-size: 22px !important; text-align: center; margin-bottom: 8px !important; }
  .tora-steps { margin-bottom: 24px; }
  .tora-step-title { font-size: 18px !important; }
  .tora-il-row { flex-direction: column; gap: 10px; }
  
  /* Better touch targets */
  .tora-list-item {
    padding: 16px;
    min-height: 56px;
  }
  
  .tora-btn {
    min-height: 52px;
    padding: 16px;
    font-size: 16px;
  }
  
  /* Input with button mobile - side by side */
  .tora-input-with-btn {
    flex-direction: row;
    gap: 8px;
  }
  .tora-input-with-btn input {
    flex: 1;
  }
  .tora-input-btn {
    flex-shrink: 0;
    width: auto;
    padding: 14px 20px;
  }
  
  /* Collapse toggle mobile - hide il/ilce section */
  .tora-collapse {
    display: none !important;
  }
  
  /* Sticky bar mobile optimization */
  .tora-sticky-bar {
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  
  .tora-sticky-btn {
    padding: 14px 24px;
    font-size: 15px;
  }
}

/* ── Tablet ── */
@media (min-width: 481px) and (max-width: 768px) {
  .tora-sticky-bar {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
}

/* ── Desktop - Hide Sticky Bar ── */
@media (min-width: 769px) {
  .tora-sticky-bar { display: none !important; }
}

/* ── Safe Area Support (iPhone X+) ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .tora-sticky-bar {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
  
  .tora-modal-overlay {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
