/* ==========================================================================
   BİLKAR SİGORTA — Comprehensive Design System & Component Library
   Tailwind CSS v3 Companion Stylesheet (100% Mobile Optimized)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Root Variables & Theme Colors & Base Reset
   -------------------------------------------------------------------------- */
:root {
  --brand-500: #DE2A1B;
  --brand-600: #C52214;
  --brand-700: #9E160A;
  --brand-50: #FFF1F0;
  --brand-100: #FFE1DF;
  --whatsapp: #25D366;
  --whatsapp-hover: #20BA5A;
  --slate-900: #0F172A;
  --slate-950: #020617;
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  overflow-x: hidden;
  max-width: 100vw;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
  position: relative;
  touch-action: manipulation;
}

/* Prevent iOS auto-zoom on input focus */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* --------------------------------------------------------------------------
   2. Custom Animations & Keyframes
   -------------------------------------------------------------------------- */
@keyframes marqueeScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

@keyframes typingDots {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.animate-marquee {
  display: flex;
  flex-shrink: 0;
  white-space: nowrap;
  will-change: transform;
  animation: marqueeScroll 32s linear infinite;
  pointer-events: none;
}

.marquee-mask {
  mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
}

.animate-pulse-glow {
  animation: pulseGlow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* --------------------------------------------------------------------------
   3. Scroll Reveal Animations
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   4. Glassmorphism & Atmospheric Backgrounds
   -------------------------------------------------------------------------- */
.glass-header {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass-card {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.glass-dark {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bg-grid-pattern {
  background-image: radial-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* --------------------------------------------------------------------------
   5. Interactive Hero Carousel Slider (Rock-Solid CSS Grid Layout)
   -------------------------------------------------------------------------- */
.hero-slides-wrapper {
  display: grid;
  grid-template-columns: 100%;
  grid-template-rows: auto;
  position: relative;
  width: 100%;
}

.hero-slide {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  word-break: break-word;
  overflow-wrap: break-word;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 2;
}

.hero-dot {
  height: 5px;
  border-radius: 9999px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
  padding: 0;
}

.hero-dot.is-active {
  width: 36px;
  background-color: var(--brand-500) !important;
  box-shadow: 0 2px 8px rgba(222, 42, 27, 0.4);
}

.hero-dot:not(.is-active) {
  width: 12px;
  background-color: #CBD5E1;
}

.hero-dot:not(.is-active):hover {
  background-color: #94A3B8;
  width: 16px;
}

/* --------------------------------------------------------------------------
   6. Interactive Quick Quote Card & Tabs
   -------------------------------------------------------------------------- */
.quote-tab-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.quote-tab-btn.is-active {
  background-color: #FFFFFF !important;
  color: var(--brand-500) !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08) !important;
}

/* --------------------------------------------------------------------------
   6. FAQ Accordion
   -------------------------------------------------------------------------- */
.accordion-item {
  transition: all 0.25s ease;
  border-left: 3px solid transparent;
}

.accordion-item.is-open {
  border-left-color: var(--brand-500) !important;
  background-color: #FFFFFF !important;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.1) !important;
}

.accordion-item.is-open .accordion-btn {
  color: var(--brand-500);
}

.accordion-item.is-open .accordion-btn i {
  transform: rotate(180deg);
  color: var(--brand-500);
}

.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   7. Back to Top Button
   -------------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 92px;
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  background-color: #0F172A;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--brand-500);
  transform: translateY(-3px);
  box-shadow: 0 12px 25px -4px rgba(222, 42, 27, 0.4);
}

/* --------------------------------------------------------------------------
   8. WhatsApp Interactive Chatbot Widget Modal
   -------------------------------------------------------------------------- */
.wa-chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 375px;
  max-width: calc(100vw - 32px);
  max-height: min(560px, calc(100vh - 120px));
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  z-index: 70;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.wa-chat-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.wa-chat-head {
  background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
  padding: 13px 16px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  flex-shrink: 0;
}

.wa-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.wa-chat-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-chat-head-info {
  flex-grow: 1;
  min-width: 0;
}

.wa-chat-head-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wa-chat-head-info span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
}

.wa-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: #25D366;
  box-shadow: 0 0 6px #25D366;
  flex-shrink: 0;
}

.wa-chat-close {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 9999px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.wa-chat-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.wa-chat-body {
  padding: 14px;
  background-color: #EFEAE2;
  background-image: radial-gradient(#0000000a 1px, transparent 1px);
  background-size: 16px 16px;
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wa-msg-bot {
  align-self: flex-start;
  max-width: 90%;
  background: #FFFFFF;
  padding: 11px 13px;
  border-radius: 0 16px 16px 16px;
  font-size: 13px;
  line-height: 1.45;
  color: #1E293B;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
  word-break: break-word;
}

.wa-msg-user {
  align-self: flex-end;
  max-width: 90%;
  background: #D9FDD3;
  padding: 10px 13px;
  border-radius: 16px 0 16px 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #0F172A;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
  word-break: break-word;
}

.wa-chat-time {
  display: block;
  text-align: right;
  font-size: 10px;
  color: #94A3B8;
  margin-top: 4px;
}

/* Interactive Chatbot Option Chips */
.wa-bot-chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.wa-chip-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #0F172A;
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.wa-chip-btn:hover {
  background: #F0FDF4;
  border-color: #25D366;
  color: #075E54;
}

.wa-chip-btn i {
  color: #25D366;
  font-size: 10px;
  margin-left: 6px;
}

/* Typing Indicator Animation */
.wa-typing-indicator {
  display: none;
  align-self: flex-start;
  background: #FFFFFF;
  padding: 7px 12px;
  border-radius: 0 14px 14px 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wa-typing-indicator.is-visible {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wa-typing-indicator span {
  width: 6px;
  height: 6px;
  background-color: #94A3B8;
  border-radius: 9999px;
  animation: typingDots 1.4s infinite ease-in-out both;
}
.wa-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.wa-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

/* Chatbot Input Footer */
.wa-chat-input-bar {
  padding: 9px 12px;
  background: #FFFFFF;
  border-top: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.wa-chat-input-bar input {
  flex-grow: 1;
  min-width: 0;
  border: 1px solid #E2E8F0;
  background: #F8FAFC;
  padding: 8px 14px;
  border-radius: 9999px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s, background-color 0.2s;
}

.wa-chat-input-bar input:focus {
  border-color: #25D366;
  background: #FFFFFF;
}

.wa-chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: #25D366;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.2s, transform 0.1s;
}

.wa-chat-send-btn:hover {
  background: #20BA5A;
  transform: scale(1.05);
}

/* Floating button states */
.float-whatsapp.is-active i.fa-whatsapp {
  display: none !important;
}
.float-whatsapp.is-active i.fa-xmark {
  display: block !important;
}

/* --------------------------------------------------------------------------
   9. Mobile Specific Responsive Layout & Chatbot Modal Tuning
   -------------------------------------------------------------------------- */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.09);
  z-index: 80;
  gap: 8px;
}

@media (max-width: 768px) {
  .mobile-cta-bar {
    display: flex;
  }
  
  body {
    padding-bottom: 76px !important;
  }
  
  /* Hide redundant call floating icon on mobile */
  .float-call {
    display: none !important;
  }

  /* WhatsApp floating icon positioned above bottom bar */
  .float-stack {
    bottom: 80px !important;
    right: 14px !important;
    z-index: 70 !important;
  }

  /* Back-to-top button on bottom-left */
  .back-to-top {
    bottom: 80px !important;
    left: 14px !important;
    right: auto !important;
    width: 42px !important;
    height: 42px !important;
    font-size: 14px !important;
    z-index: 70 !important;
  }

  /* Chatbot Modal on Mobile (Full Screen-safe Sheet Overlay) */
  .wa-chat-panel {
    bottom: 76px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 90px) !important;
    border-radius: 20px !important;
    z-index: 999 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35) !important;
  }

  .wa-chat-body {
    padding: 12px !important;
    gap: 10px !important;
  }

  .wa-msg-bot, .wa-msg-user {
    font-size: 13px !important;
    padding: 10px 13px !important;
    max-width: 92% !important;
  }

  .wa-chip-btn {
    font-size: 12px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
  }

  .wa-chat-input-bar {
    padding: 9px 12px !important;
  }

  .wa-chat-send-btn {
    width: 36px !important;
    height: 36px !important;
    font-size: 13px !important;
  }
}

.mobile-cta-bar a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
}

.mobile-cta-bar .mc-call {
  background: #0F172A;
  color: #FFFFFF;
}

.mobile-cta-bar .mc-whatsapp {
  background: var(--whatsapp);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   10. Custom Scrollbar
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-500);
}

/* --------------------------------------------------------------------------
   11. Blog Article Reader Modal & Google Reviews
   -------------------------------------------------------------------------- */
.blog-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.blog-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.blog-modal-content {
  background: #FFFFFF;
  border-radius: 28px;
  max-width: 720px;
  width: 100%;
  max-height: min(90dvh, 800px);
  overflow-y: auto;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(226, 232, 240, 0.9);
  transform: scale(0.94) translateY(15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   12. Google Reviews Carousel Showcase
   -------------------------------------------------------------------------- */
.reviews-slider-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 10px 4px 24px;
}

.reviews-slider-track::-webkit-scrollbar {
  height: 6px;
}

.reviews-slider-track::-webkit-scrollbar-track {
  background: #F1F5F9;
  border-radius: 9999px;
}

.reviews-slider-track::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 9999px;
}

.reviews-slider-track::-webkit-scrollbar-thumb:hover {
  background: var(--brand-500);
}

.review-card {
  flex: 0 0 340px;
  max-width: 340px;
  scroll-snap-align: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

@media (max-width: 640px) {
  .review-card {
    flex: 0 0 88vw;
    max-width: 88vw;
  }
}

.review-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 35px -10px rgba(15, 23, 42, 0.12);
}

.google-g-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.rev-ctrl-btn {
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0F172A;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.rev-ctrl-btn:hover {
  background: var(--brand-500);
  color: #FFFFFF;
  border-color: var(--brand-500);
  transform: scale(1.05);
}

.rev-ctrl-btn:active {
  transform: scale(0.95);
}

