/* ═══════════════════════════════════════════════════════════════
 * ORTAKSISTEM — MÜŞTERİ GİRİŞ BUTONU & OTP MODAL CSS
 * ═══════════════════════════════════════════════════════════════
 * Header müşteri giriş, dropdown profil ve OTP doğrulama modali
 */

/* ── Header Müşteri Giriş Butonu ───────────────────────────── */
.customer-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #a855f7 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 2px 10px rgba(99, 102, 241, 0.35),
    0 0 0 0 rgba(139, 92, 246, 0);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.customer-login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 50%);
  pointer-events: none;
  border-radius: inherit;
}

.customer-login-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 
    0 6px 24px rgba(99, 102, 241, 0.45),
    0 0 0 3px rgba(139, 92, 246, 0.15);
}

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

.customer-login-btn .login-icon {
  font-size: 1.1rem;
  filter: brightness(1.1);
}

.customer-login-btn .login-label {
  display: inline;
}

.customer-login-btn .login-badge-dot {
  width: 8px;
  height: 8px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
  animation: pulseDot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* Mobilde kısa versiyon */
@media (max-width: 480px) {
  .customer-login-btn {
    padding: 8px 12px;
  }
  .customer-login-btn .login-label {
    display: none;
  }
}

/* ── Giriş Yapılmış Avatar Butonu ──────────────────────────── */
.customer-header-logged {
  position: relative;
}

.customer-avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 4px 4px;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.25s var(--ease-default);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.customer-avatar-btn:hover {
  background: var(--bg-primary);
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15);
}

.customer-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.customer-avatar-circle.lg {
  width: 42px;
  height: 42px;
  font-size: 1.1rem;
}

.customer-name-label {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

@media (max-width: 480px) {
  .customer-name-label,
  .dropdown-arrow {
    display: none;
  }
  .customer-avatar-btn {
    padding: 4px;
    border-radius: 50%;
  }
}

/* ── Müşteri Dropdown ──────────────────────────────────────── */
.customer-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: var(--z-popover);
  overflow: hidden;
}

.customer-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.customer-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.06));
}

.customer-dropdown-divider {
  height: 1px;
  background: var(--border-color);
}

.customer-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.customer-dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}

.customer-dropdown-item.logout {
  color: var(--danger);
}

.customer-dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.06);
  color: var(--danger);
}

/* ══════════════════════════════════════════════════════════════
 * OTP LOGIN MODAL
 * ══════════════════════════════════════════════════════════════ */

.otp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: all 0.35s ease;
}

.otp-modal-overlay.open {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.otp-modal {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border-radius: var(--radius-2xl);
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 36px 32px;
  position: relative;
  transform: scale(0.9) translateY(30px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow-y: auto;
  max-height: 90vh;
}

.otp-modal.open {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.otp-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
}

.otp-modal-close:hover {
  background: var(--danger);
  color: #fff;
  transform: rotate(90deg);
}

/* Modal İkon */
.otp-modal-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.otp-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 
    0 8px 24px rgba(99, 102, 241, 0.35),
    0 0 0 6px rgba(99, 102, 241, 0.1);
  animation: iconPulse 3s ease-in-out infinite;
}

.otp-icon-circle.otp-icon-verify {
  background: linear-gradient(135deg, #22c55e, #10b981);
  box-shadow: 
    0 8px 24px rgba(34, 197, 94, 0.35),
    0 0 0 6px rgba(34, 197, 94, 0.1);
}

@keyframes iconPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35), 0 0 0 6px rgba(99, 102, 241, 0.1); }
  50% { box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45), 0 0 0 10px rgba(99, 102, 241, 0.05); }
}

/* Modal Başlık & Açıklama */
.otp-modal-title {
  text-align: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.otp-modal-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* WhatsApp Badge */
.otp-whatsapp-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(37, 211, 102, 0.05));
  border: 1px solid rgba(37, 211, 102, 0.25);
  border-radius: var(--radius-lg);
  color: #25d366;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 24px;
}

/* Telefon Input */
.otp-form-group {
  margin-bottom: 20px;
}

.otp-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.otp-phone-input-wrapper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s ease;
  background: var(--bg-secondary);
}

.otp-phone-input-wrapper:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  background: var(--bg-primary);
}

.otp-country-code {
  padding: 14px 14px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9rem;
  border-right: 1.5px solid var(--border-color);
  user-select: none;
  white-space: nowrap;
}

.otp-phone-input {
  flex: 1;
  padding: 14px 16px;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  outline: none;
  letter-spacing: 0.05em;
}

.otp-phone-input::placeholder {
  color: var(--text-tertiary);
  font-weight: 400;
}

/* Submit Buton */
.otp-submit-btn {
  margin-top: 4px;
  border-radius: var(--radius-lg) !important;
  font-size: 0.95rem !important;
  padding: 14px 20px !important;
  letter-spacing: 0.01em;
}

/* Footer Metin */
.otp-modal-footer-text {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 20px;
}

.otp-modal-footer-text a {
  color: var(--primary);
  text-decoration: underline;
}

/* ── OTP Kod Giriş Alanları ────────────────────────────────── */
.otp-code-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 16px;
}

.otp-code-input {
  width: 48px;
  height: 58px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: all 0.25s ease;
  caret-color: #6366f1;
}

.otp-code-input:focus {
  border-color: #6366f1;
  background: var(--bg-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
  transform: translateY(-2px);
}

.otp-code-input:not(:placeholder-shown) {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

.otp-code-dash {
  color: var(--text-tertiary);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0 2px;
  user-select: none;
}

/* Timer */
.otp-timer-wrapper {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  font-variant-numeric: tabular-nums;
}

.otp-resend-link {
  color: #6366f1;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s;
}

.otp-resend-link:hover {
  color: #4f46e5;
  text-decoration: underline;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  .otp-modal {
    padding: 28px 20px;
    border-radius: 20px;
    margin: 10px;
  }

  .otp-code-input {
    width: 42px;
    height: 50px;
    font-size: 1.25rem;
  }

  .otp-code-inputs {
    gap: 6px;
  }

  .otp-icon-circle {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .otp-modal-title {
    font-size: 1.25rem;
  }
}

/* ── Dark Mode Düzeltmeleri ─────────────────────────────────── */
[data-theme="dark"] .customer-login-btn {
  box-shadow: 
    0 2px 14px rgba(99, 102, 241, 0.4),
    0 0 0 0 rgba(139, 92, 246, 0);
}

[data-theme="dark"] .otp-modal {
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .otp-whatsapp-badge {
  background: rgba(37, 211, 102, 0.08);
  border-color: rgba(37, 211, 102, 0.2);
}

[data-theme="dark"] .customer-dropdown {
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .customer-dropdown-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.08));
}
