/*!
 * Karasoy CMP — Cookie consent banner & modal styling
 * MD3 tokens + Karasoy palette uyumlu
 */

/* ----- Banner (fixed bottom) ----- */
.karasoy-cmp-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: var(--md-sys-color-surface, #fff);
  color: var(--md-sys-color-on-surface, #0a2540);
  border-top: 1px solid var(--md-sys-color-outline, rgba(10, 37, 64, 0.2));
  box-shadow: 0 -8px 24px rgba(10, 37, 64, 0.12);
  transform: translateY(100%);
  transition: transform 320ms cubic-bezier(0.2, 0, 0, 1);
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.55;
}
.karasoy-cmp-banner.is-shown {
  transform: translateY(0);
}
.karasoy-cmp-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
@media (min-width: 768px) {
  .karasoy-cmp-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }
}
.karasoy-cmp-banner-text { flex: 1; }
.karasoy-cmp-banner-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--md-sys-color-primary, #0a2540);
}
.karasoy-cmp-banner-body {
  margin: 0;
  font-size: 13px;
  opacity: 0.85;
}
.karasoy-cmp-banner-body strong { font-weight: 600; }
.karasoy-cmp-link {
  color: var(--md-sys-color-secondary, #2563eb);
  text-decoration: underline;
}
.karasoy-cmp-link:hover { opacity: 0.8; }

.karasoy-cmp-banner-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .karasoy-cmp-banner-btns { flex-direction: column; width: 100%; }
}
.karasoy-cmp-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--md-sys-shape-corner-small, 6px);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms, border-color 160ms, color 160ms;
  min-height: 40px;
  white-space: nowrap;
}
.karasoy-cmp-btn-reject {
  background: transparent;
  color: var(--md-sys-color-on-surface, #0a2540);
  border-color: var(--md-sys-color-outline, rgba(10, 37, 64, 0.3));
}
.karasoy-cmp-btn-reject:hover { background: var(--md-sys-color-surface-container, #f1f5f9); }
.karasoy-cmp-btn-prefs {
  background: var(--md-sys-color-surface-container, #f1f5f9);
  color: var(--md-sys-color-on-surface, #0a2540);
}
.karasoy-cmp-btn-prefs:hover { background: var(--md-sys-color-surface-container-high, #e2e8f0); }
.karasoy-cmp-btn-accept {
  background: var(--md-sys-color-primary, #0a2540);
  color: var(--md-sys-color-on-primary, #fff);
}
.karasoy-cmp-btn-accept:hover { background: var(--md-sys-color-secondary, #2563eb); }

/* ----- Modal (preferences) ----- */
.karasoy-cmp-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.karasoy-cmp-modal.is-open { display: flex; }
.karasoy-cmp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 37, 64, 0.55);
  backdrop-filter: blur(2px);
}
.karasoy-cmp-modal-panel {
  position: relative;
  background: var(--md-sys-color-surface, #fff);
  color: var(--md-sys-color-on-surface, #0a2540);
  border-radius: var(--md-sys-shape-corner-medium, 12px);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(10, 37, 64, 0.3);
}
.karasoy-cmp-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant, rgba(10, 37, 64, 0.12));
}
.karasoy-cmp-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-primary, #0a2540);
}
.karasoy-cmp-modal-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--md-sys-color-on-surface, #0a2540);
  border-radius: 4px;
}
.karasoy-cmp-modal-close:hover { background: var(--md-sys-color-surface-container, #f1f5f9); }
.karasoy-cmp-modal-intro {
  padding: 16px 24px 0;
  margin: 0;
  font-size: 13px;
  opacity: 0.85;
}
.karasoy-cmp-cats {
  padding: 16px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.karasoy-cmp-cat {
  border: 1px solid var(--md-sys-color-outline-variant, rgba(10, 37, 64, 0.12));
  border-radius: var(--md-sys-shape-corner-small, 8px);
  padding: 14px 16px;
}
.karasoy-cmp-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.karasoy-cmp-cat-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface, #0a2540);
}
.karasoy-cmp-cat-desc {
  font-size: 12px;
  opacity: 0.78;
  margin: 0;
}
.karasoy-cmp-cat-examples {
  font-size: 11px;
  opacity: 0.6;
  font-style: italic;
  margin-top: 4px;
}
.karasoy-cmp-cat-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.karasoy-cmp-cat-toggle input {
  appearance: none;
  width: 100%;
  height: 100%;
  background: var(--md-sys-color-outline, rgba(10, 37, 64, 0.3));
  border-radius: 11px;
  cursor: pointer;
  transition: background 160ms;
  margin: 0;
}
.karasoy-cmp-cat-toggle input:checked { background: var(--md-sys-color-primary, #0a2540); }
.karasoy-cmp-cat-toggle input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 160ms;
}
.karasoy-cmp-cat-toggle input:checked::before { transform: translateX(18px); }
.karasoy-cmp-cat-toggle input:disabled { cursor: not-allowed; opacity: 0.7; }
.karasoy-cmp-cat-always-on {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--md-sys-color-success, #15803d);
  font-weight: 600;
  flex-shrink: 0;
}
.karasoy-cmp-modal-foot {
  padding: 16px 24px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
@media (max-width: 480px) {
  .karasoy-cmp-modal-foot { flex-direction: column-reverse; }
  .karasoy-cmp-modal-foot .karasoy-cmp-btn { width: 100%; }
}

/* ----- Mobile bottom navigation bar ----- */
@media (max-width: 767px) {
  /* Hide desktop nav-links AND hamburger on mobile, replace with bottom-nav */
  .k-header .k-nav-links,
  .k-header .wp-block-navigation__responsive-container-open,
  .k-header .wp-block-navigation__responsive-container { display: none !important; }

  body { padding-bottom: 64px; }

  .k-mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--md-sys-color-surface, #fff);
    border-top: 1px solid var(--md-sys-color-outline-variant, rgba(10, 37, 64, 0.12));
    box-shadow: 0 -4px 16px rgba(10, 37, 64, 0.08);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 6px 4px 8px;
    backdrop-filter: blur(8px);
  }
  .k-mobile-bottom-nav a,
  .k-mobile-bottom-nav button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--md-sys-color-on-surface, #0a2540);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    border-radius: 8px;
    background: transparent;
    border: 0;
    transition: background 160ms;
    min-width: 0;
  }
  .k-mobile-bottom-nav a:active,
  .k-mobile-bottom-nav button:active {
    background: var(--md-sys-color-surface-container, #f1f5f9);
  }
  .k-mobile-bottom-nav .icon {
    font-size: 22px;
    line-height: 1;
  }
  .k-mobile-bottom-nav .label {
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}
@media (min-width: 768px) {
  .k-mobile-bottom-nav { display: none; }
}

/* ----- Map placeholder click-to-load ----- */
.karasoy-map-placeholder {
  width: 100%;
  height: 100%;
}
/* When iframe rendered, override grid centering to fill container */
.karasoy-map-placeholder[data-rendered="iframe"] {
  display: block !important;
  padding: 0 !important;
}
.karasoy-map-placeholder iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.karasoy-map-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  gap: 8px;
}
.karasoy-map-icon { font-size: 32px; opacity: 0.5; }
.karasoy-map-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.karasoy-map-desc {
  font-size: 12px;
  opacity: 0.75;
  margin: 0 0 8px;
}
.karasoy-map-load {
  background: var(--md-sys-color-primary, #0a2540);
  color: var(--md-sys-color-on-primary, #fff);
  border: 0;
  border-radius: var(--md-sys-shape-corner-small, 6px);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.karasoy-map-load:hover { background: var(--md-sys-color-secondary, #2563eb); }
.karasoy-map-policy {
  font-size: 11px;
  opacity: 0.7;
  text-decoration: underline;
}

/* ============================================================
 * Contact Form Feedback (loading, status, field errors, success)
 * ============================================================ */

.k-form-wrap {
  position: relative;
}

/* Form fade out when success card takes over */
.k-form {
  transition: opacity 220ms ease, transform 220ms ease;
}
.k-form.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  position: absolute;
  inset: 0;
  visibility: hidden;
}

/* Field wrapper */
.k-field {
  display: flex;
  flex-direction: column;
}

/* Invalid input — kırmızı border + soft glow */
.k-input.is-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.k-input.is-invalid:focus {
  outline: none;
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.22);
}

.k-field-error {
  display: block;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  color: #dc2626;
  font-size: 12px;
  line-height: 1.4;
  margin-top: 0;
  transition: max-height 180ms ease, margin-top 180ms ease;
}
.k-field-error:not(:empty) {
  max-height: 40px;
  margin-top: 4px;
}

/* Submit button + spinner */
.k-submit {
  position: relative;
  transition: background 200ms ease, opacity 200ms ease;
}
.k-submit-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: k-spin 0.7s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
  opacity: 0.85;
}
.k-form.is-loading .k-submit-spinner {
  display: inline-block;
}
.k-form.is-loading .k-submit {
  cursor: progress;
}
.k-form.is-loading .k-input,
.k-form.is-loading .k-input:disabled {
  opacity: 0.65;
  pointer-events: none;
}

@keyframes k-spin {
  to { transform: rotate(360deg); }
}

/* Shake on error */
@keyframes k-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.k-form.is-shake {
  animation: k-shake 380ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Status box — success/error styled */
.k-form-status {
  font-size: 13px;
  line-height: 1.5;
  border-radius: 10px;
  padding: 0 14px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 240ms ease, opacity 240ms ease, padding 240ms ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.k-form-status.is-visible {
  max-height: 100px;
  opacity: 1;
  padding: 12px 14px;
}
.k-form-status.is-success {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.k-form-status.is-error {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
  border: 1px solid rgba(220, 38, 38, 0.30);
}
.k-form-status::before {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  content: "";
}
.k-form-status.is-success::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315803d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6L9 17l-5-5'/></svg>");
}
.k-form-status.is-error::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M12 8v5'/><circle cx='12' cy='16' r='1' fill='%23b91c1c' stroke='none'/></svg>");
}

/* Success card */
.k-form-success {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 320ms ease, transform 320ms ease;
  background: var(--md-sys-color-surface, #fff);
  border: 1px solid rgba(34, 197, 94, 0.30);
  border-radius: 12px;
  padding: 36px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.k-form-success.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.k-form-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.k-form-success-icon svg {
  display: block;
}
.k-form-success-icon .check-circle {
  stroke: #22c55e;
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  animation: k-check-circle 480ms cubic-bezier(0.65, 0, 0.45, 1) 80ms forwards;
}
.k-form-success-icon .check-tick {
  stroke: #22c55e;
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: k-check-tick 320ms cubic-bezier(0.65, 0, 0.45, 1) 480ms forwards;
}
@keyframes k-check-circle { to { stroke-dashoffset: 0; } }
@keyframes k-check-tick { to { stroke-dashoffset: 0; } }
.k-form-success-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--md-sys-color-on-surface, #0a2540);
}
.k-form-success-msg {
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
  color: var(--md-sys-color-on-surface-variant, #475569);
  max-width: 320px;
}
.k-form-success-reset {
  margin-top: 6px;
}

/* CTA buton stilleri — Gutenberg validation core button save'ında inner <a>
   class'ının `wp-block-button__link wp-element-button` olmasını bekliyor.
   Tailwind/DaisyUI class'ları inner <a>'da invalid block uyarısı tetikledi;
   stil burada CSS olarak sürdürülüyor. Hero ve career-cta CTA'ları için. */
.k-hero-cta .wp-block-button__link,
.k-career-cta .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: 0;
  background-color: var(--color-base-100, #ffffff);
  color: var(--color-base-content, #0a2540);
  font-weight: 600;
  transition: background-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.k-hero-cta .wp-block-button__link:hover,
.k-career-cta .wp-block-button__link:hover {
  background-color: var(--color-base-200, #f1f5f9);
  color: var(--color-base-content, #0a2540);
}

/* WP block-gap × Tailwind grid uyumsuzluğu:
   WP layout (flow/constrained) parent'ları `* + *`'a margin-block-start
   ekler. Tailwind .grid + gap-* zaten görsel boşluğu sağladığından,
   grid hücrelerine düşen bu marjin hizayı bozuyor. Grid context'inde
   block-gap'i nötralize et. */
.grid.is-layout-flow > * + *,
.grid.is-layout-constrained > * + *,
.grid.wp-block-group-is-layout-flow > * + *,
.grid.wp-block-group-is-layout-constrained > * + * {
  margin-block-start: 0;
}

