/*
  KadroNet Offline Site - Custom Patches
  ------------------------------------------------------------
  Bu dosya, derlenmiş (build) çıktıyı bozmadan istenen davranışları
  eklemek/düzeltmek için eklendi.
*/

:root {
  /* Theme variables (light defaults) */
  --kn-bg: #ffffff;
  --kn-surface: #ffffff;
  --kn-surface-2: #f8fafc; /* slate-50 */
  --kn-surface-3: #f1f5f9; /* slate-100 */
  --kn-text: #0f172a; /* slate-900 */
  --kn-muted: #94a3b8; /* slate-400 */
  --kn-border: rgba(148, 163, 184, 0.35);

  --kn-nav-top-bg: rgba(255, 255, 255, 0.95);
  --kn-nav-top-fg: #1e3a8a; /* blue-900 */
  --kn-nav-border: rgba(2, 6, 23, 0.08);

  --kn-whatsapp-bg: #25d366;
}

html[data-theme="dark"] {
  --kn-bg: #0b1220;
  --kn-surface: #0f172a;
  --kn-surface-2: #0b1220;
  --kn-surface-3: #111c33;
  --kn-text: #e2e8f0;
  --kn-muted: #94a3b8;
  --kn-border: rgba(148, 163, 184, 0.22);

  --kn-nav-top-bg: rgba(15, 23, 42, 0.92);
  --kn-nav-top-fg: #e2e8f0;
  --kn-nav-border: rgba(148, 163, 184, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--kn-bg);
  color: var(--kn-text);
}

/* Hide empty paragraphs to avoid spacing gaps (e.g., Hikayemiz) */
.space-y-6 > p:empty {
  display: none !important;
}

/* Prevent phone numbers from breaking into multiple lines */
a[href^="tel:"],
.kn-nowrap {
  white-space: nowrap;
}

/* ---------------------------
   Dark mode overrides for common Tailwind utility classes
---------------------------- */
html[data-theme="dark"] .bg-white {
  background-color: var(--kn-surface) !important;
}
html[data-theme="dark"] .bg-gray-50 {
  background-color: var(--kn-surface-2) !important;
}
html[data-theme="dark"] .bg-gray-100 {
  background-color: var(--kn-surface-3) !important;
}
html[data-theme="dark"] .bg-blue-50 {
  background-color: rgba(37, 99, 235, 0.10) !important;
}
html[data-theme="dark"] .text-gray-900,
html[data-theme="dark"] .text-gray-800 {
  color: var(--kn-text) !important;
}
html[data-theme="dark"] .text-gray-700,
html[data-theme="dark"] .text-gray-600,
html[data-theme="dark"] .text-gray-500,
html[data-theme="dark"] .text-gray-400 {
  color: var(--kn-muted) !important;
}
html[data-theme="dark"] .border-gray-200,
html[data-theme="dark"] .border-gray-300 {
  border-color: var(--kn-border) !important;
}

/* ---------------------------
   Navbar (NEW: hide on scroll down / show on scroll up)
---------------------------- */
nav.kn-navbar {
  background: var(--kn-nav-top-bg) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--kn-nav-border);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.10);

  transition: transform 240ms ease, opacity 240ms ease, background-color 300ms ease, backdrop-filter 300ms ease,
    box-shadow 300ms ease;
  will-change: transform;
}

nav.kn-navbar a,
nav.kn-navbar button,
nav.kn-navbar span {
  color: var(--kn-nav-top-fg) !important;
}

nav.kn-navbar.kn-navbar--hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

/* Nav action buttons inserted by custom.js */
.kn-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.kn-tanisalim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(37, 99, 235, 0.92);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.18);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.kn-tanisalim-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.22);
}

.kn-tanisalim-btn:active {
  transform: translateY(0);
}

.kn-theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.14);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

nav.kn-navbar .kn-theme-toggle {
  border: 1px solid rgba(30, 58, 138, 0.18);
  background: rgba(30, 58, 138, 0.08);
}

html[data-theme="dark"] nav.kn-navbar .kn-theme-toggle {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.08);
}

.kn-theme-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ---------------------------
   Hero video replacement (16:9)
---------------------------- */
.kn-hero-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.25);
}

.kn-hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.94;
}

.kn-hero-video-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 42, 74, 0.12), rgba(11, 42, 74, 0.28));
  pointer-events: none;
}

.kn-hero-sound-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 10px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(2, 6, 23, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.kn-hero-sound-btn:hover {
  background: rgba(2, 6, 23, 0.55);
}

.kn-hero-sound-btn:active {
  transform: scale(0.98);
}


/* ---------------------------
   Home hero: full background video (cover)
---------------------------- */
.kn-hero-bg {
  position: relative;
}

.kn-hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none; /* do not block scroll/touch */
  transform: translateZ(0);
}

/* Ensure existing overlay layer doesn't block scrolling */
.kn-hero-bg .bg-black\/20 {
  pointer-events: none;
}

/* ---------------------------
   Kurumsal > Hikayemiz video (9:16)
---------------------------- */
.kn-hikayemiz-media {
  display: flex;
  gap: 16px;
  align-items: stretch;
}

.kn-hikayemiz-photo {
  flex: 1 1 auto;
  min-width: 0;
}

.kn-hikayemiz-video {
  aspect-ratio: 9 / 16;
  width: min(340px, 100%);
  max-width: 360px;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 16px 34px rgba(2, 6, 23, 0.18);
  position: relative;
  margin-left: auto;
  margin-right: auto;
}

.kn-hikayemiz-video .kn-vertical-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kn-inline-sound-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 8px 10px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(2, 6, 23, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.kn-inline-sound-btn:hover {
  background: rgba(2, 6, 23, 0.55);
}

@media (max-width: 768px) {
  .kn-hikayemiz-media {
    flex-direction: column;
  }
  .kn-hikayemiz-video {
    flex: 0 0 auto;
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ---------------------------
   Team avatars (3D emoji style)
---------------------------- */
.kn-team-avatar {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 9999px;
  overflow: hidden;
}

/* ---------------------------
   Dark mode contact form input text color (black)
---------------------------- */
html[data-theme="dark"] form.kn-contact-form input,
html[data-theme="dark"] form.kn-contact-form textarea,
html[data-theme="dark"] form.kn-contact-form select {
  color: #0f172a !important;
  background-color: #ffffff !important;
}

html[data-theme="dark"] form.kn-contact-form input::placeholder,
html[data-theme="dark"] form.kn-contact-form textarea::placeholder {
  color: rgba(15, 23, 42, 0.55) !important;
}

/* ---------------------------
   Dark mode Hizmetler tabs text mismatch
   (Keep this part readable: light cards + black text; blue headings untouched)
---------------------------- */
html[data-theme="dark"] .kn-services-tabs .bg-white {
  background-color: #ffffff !important;
}
html[data-theme="dark"] .kn-services-tabs .bg-gray-50 {
  background-color: #f8fafc !important;
}
html[data-theme="dark"] .kn-services-tabs .bg-gray-100 {
  background-color: #f1f5f9 !important;
}

html[data-theme="dark"] .kn-services-tabs .text-white,
html[data-theme="dark"] .kn-services-tabs .text-gray-900,
html[data-theme="dark"] .kn-services-tabs .text-gray-800,
html[data-theme="dark"] .kn-services-tabs .text-gray-700,
html[data-theme="dark"] .kn-services-tabs .text-gray-600,
html[data-theme="dark"] .kn-services-tabs .text-gray-500,
html[data-theme="dark"] .kn-services-tabs .text-gray-400 {
  color: #0f172a !important;
}

html[data-theme="dark"] .kn-services-tabs .border-gray-200,
html[data-theme="dark"] .kn-services-tabs .border-gray-300 {
  border-color: rgba(15, 23, 42, 0.15) !important;
}


/* Make sure inherited text inside the services area stays black on light cards */
html[data-theme="dark"] .kn-services-tabs {
  color: #0f172a !important;
}

/* Hizmet detay sayfası: SSS üstündeki içerik blokları */
html[data-theme="dark"] .kn-services-detail {
  color: #0f172a !important;
}
html[data-theme="dark"] .kn-services-detail .text-white,
html[data-theme="dark"] .kn-services-detail .text-gray-900,
html[data-theme="dark"] .kn-services-detail .text-gray-800,
html[data-theme="dark"] .kn-services-detail .text-gray-700,
html[data-theme="dark"] .kn-services-detail .text-gray-600,
html[data-theme="dark"] .kn-services-detail .text-gray-500,
html[data-theme="dark"] .kn-services-detail .text-gray-400 {
  color: #0f172a !important;
}

/* SSS/FAQ: başlıkları siyah yap (dark mode'da beyaz görünmesin) */
html[data-theme="dark"] .kn-faq-scope .text-gray-900,
html[data-theme="dark"] .kn-faq-scope .text-gray-800 {
  color: #0f172a !important;
}

/* ---------------------------
   WhatsApp floating button (new icon image + interactions)
---------------------------- */
#kn-whatsapp {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: clamp(170px, 22vw, 260px);
  height: auto;
  display: block;
  z-index: 9999;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 160ms ease, filter 160ms ease;
  filter: drop-shadow(0 14px 28px rgba(2, 6, 23, 0.22));
}

#kn-whatsapp img {
  width: 100%;
  height: auto;
  display: block;
}

#kn-whatsapp:hover {
  transform: translateY(-2px) scale(1.01);
  filter: drop-shadow(0 18px 34px rgba(2, 6, 23, 0.26));
}

#kn-whatsapp:active {
  transform: translateY(0) scale(0.99);
}

@media (max-width: 480px) {
  #kn-whatsapp {
    right: 12px;
    bottom: 12px;
    width: 190px;
  }
}

/* Scroll targets: account for fixed navbar height */
.kn-scroll-target {
  scroll-margin-top: 110px;
}

/* ---------------------------
   Parallax helpers
---------------------------- */
.kn-parallax {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .kn-parallax {
    will-change: auto;
  }
}

/* ---------------------------
   Mouse "spark/lightning" particles
---------------------------- */
#kn-sparks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99999;
}

.kn-spark {
  position: absolute;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(56, 189, 248, 0),
    rgba(56, 189, 248, 0.9),
    rgba(56, 189, 248, 0)
  );
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.65));
  animation: kn-spark 380ms ease-out forwards;
  transform-origin: center;
}

@keyframes kn-spark {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(var(--r, 0deg));
  }
  to {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, 0px), 0) rotate(var(--r, 0deg));
  }
}


/* ============================================================
   Corporate UI refinements (2026-01)
   - Subtle palette + consistent UI tokens
   - Lightweight micro interactions
   - Scroll reveal animations (abartısız)
============================================================ */

/* Tailwind token overrides (bg-primary/text-primary vb. sınıflar için) */
:root {
  /* HSL tokens used by .bg-primary, .text-primary, etc. */
  --primary: 212 78% 18%;
  --secondary: 212 40% 26%;
  --ring: 212 78% 52%;

  /* Consistent rounding */
  --radius: 14px;
}

/* Dark theme token tweaks */
html[data-theme="dark"] {
  --primary: 212 84% 62%;
  --secondary: 212 40% 52%;
  --ring: 212 84% 72%;
}

/* Typography polish (kurumsal) */
body {
  letter-spacing: -0.01em;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
}

/* Tone down animated gradients (reduce CPU + more corporate) */
.animated-gradient-bg {
  animation: none !important;
  background: linear-gradient(
    135deg,
    rgba(11, 42, 74, 0.92),
    rgba(18, 58, 102, 0.92)
  ) !important;
  background-size: cover !important;
}

/* Consistent radius across common Tailwind utilities */
.rounded-sm { border-radius: 10px !important; }
.rounded { border-radius: 12px !important; }
.rounded-md { border-radius: 12px !important; }
.rounded-lg { border-radius: 14px !important; }
.rounded-xl { border-radius: 16px !important; }
.rounded-2xl { border-radius: 18px !important; }
.rounded-3xl { border-radius: 22px !important; }

/* Consistent, subtle shadows */
.shadow,
.shadow-sm,
.shadow-md,
.shadow-lg,
.shadow-xl,
.shadow-2xl {
  box-shadow:
    0 8px 20px rgba(2, 6, 23, 0.08),
    0 2px 6px rgba(2, 6, 23, 0.06) !important;
}

/* Buttons & cards: small micro animations (fast) */
button,
a[role="button"],
.kn-tanisalim-btn,
.kn-call-btn {
  transition: transform 160ms ease, box-shadow 180ms ease, background-color 180ms ease,
    border-color 180ms ease, color 180ms ease;
  will-change: transform;
}

button:active,
a[role="button"]:active,
.kn-tanisalim-btn:active,
.kn-call-btn:active {
  transform: translateY(1px);
}

/* Card hover (safe: only if element has shadow utilities) */
.shadow:hover,
.shadow-md:hover,
.shadow-lg:hover {
  transform: translateY(-2px);
}

/* Video sound buttons: align nicely */
.kn-video-sound-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
}

/* Custom team photo (Doğukan Ali Arda) - transparent background friendly */
.kn-team-avatar--custom {
  object-fit: contain !important;
  background: transparent !important;
}

/* Subtle scroll reveal */
.kn-reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 260ms ease, transform 320ms ease;
}

.kn-reveal.kn-reveal--in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .kn-reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
