/* ==========================================================================
   Kastaş — Modern Cookie Consent Banner (v2 — 3 button + Settings modal)
   --------------------------------------------------------------------------
   Eski .cc-window / cookieconsent kütüphanesi kaldırıldı; tamamen custom UI.
   Class prefix: .kc- (Kastas Cookie)
   ========================================================================== */

/* ----- Banner: tam genişlik, alt bant, ortalanmış kart ----- */
.kc-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99998;
    padding: 16px 24px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.kc-cookie-banner.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.kc-cookie-banner__inner {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 14px;
    box-shadow:
        0 20px 50px -10px rgba(15, 23, 42, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    pointer-events: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
}

.kc-cookie-banner__text {
    flex: 1;
    min-width: 0;
}

.kc-cookie-banner__title {
    display: none; /* Banner kompakt görünsün; başlık yerine direkt mesaj */
}

.kc-cookie-banner__message {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #374151;
}

.kc-cookie-banner__message a {
    color: #1e40af;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

.kc-cookie-banner__message a:hover {
    color: #1e3a8a;
}

.kc-cookie-banner__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ----- Butonlar ----- */
.kc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: 0.01em;
    min-height: 42px;
}

/* Primary (Accept All) — kurumsal mavi */
.kc-btn--primary {
    background: #1e40af;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

.kc-btn--primary:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(30, 64, 175, 0.35);
}

.kc-btn--primary:active {
    transform: translateY(0);
}

/* Success (Save Preferences) — onay yeşili */
.kc-btn--success {
    background: #16a34a;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

.kc-btn--success:hover {
    background: #15803d;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.35);
}

.kc-btn--success:active {
    transform: translateY(0);
}

/* Secondary (Reject) — gri filled */
.kc-btn--secondary {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #f3f4f6;
}

.kc-btn--secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
    border-color: #e5e7eb;
}

/* Ghost (Settings) — outline mavi */
.kc-btn--ghost {
    background: transparent;
    color: #1e40af;
    border-color: #1e40af;
}

.kc-btn--ghost:hover {
    background: rgba(30, 64, 175, 0.06);
    border-color: #1e3a8a;
    color: #1e3a8a;
}

/* ----- Mobil responsive ----- */
@media (max-width: 768px) {
    .kc-cookie-banner {
        padding: 12px;
    }

    .kc-cookie-banner__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 18px 20px;
    }

    .kc-cookie-banner__message {
        font-size: 13px;
    }

    .kc-cookie-banner__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .kc-cookie-banner__actions .kc-btn--ghost {
        grid-column: 1 / -1; /* Settings butonu üstte tam genişlik */
        order: -1;
    }

    .kc-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ----- Settings Modal ----- */
.kc-cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.kc-cookie-modal.is-visible {
    opacity: 1;
}

.kc-cookie-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.kc-cookie-modal__panel {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    width: 92%;
    max-width: 560px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px -10px rgba(15, 23, 42, 0.35);
    transform: scale(0.96) translateY(10px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
}

.kc-cookie-modal.is-visible .kc-cookie-modal__panel {
    transform: scale(1) translateY(0);
}

.kc-cookie-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.kc-cookie-modal__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}

.kc-cookie-modal__close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    color: #9ca3af;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.kc-cookie-modal__close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.kc-cookie-modal__body {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1;
}

.kc-cookie-modal__intro {
    margin: 0 0 20px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.55;
}

/* ----- Çerez kategorisi kartı ----- */
.kc-cookie-cat {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: border-color 0.15s ease;
}

.kc-cookie-cat:hover {
    border-color: #d1d5db;
}

.kc-cookie-cat__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

/* Label: checkbox + başlık yan yana, tıklanabilir tek alan */
.kc-cookie-cat__label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

.kc-cookie-cat__title {
    font-weight: 700;
    color: #1e3a8a;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.kc-cookie-cat__desc {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.55;
    padding-left: 28px; /* checkbox genişliği + gap */
}

.kc-cookie-cat__status--locked {
    font-size: 11px;
    font-weight: 700;
    color: #166534;
    background: #dcfce7;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Modern büyük checkbox */
.kc-cookie-cat__check {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
    margin: 0;
}

.kc-cookie-cat__check:hover:not(:disabled) {
    border-color: #1e40af;
}

.kc-cookie-cat__check:checked {
    background: #1e40af;
    border-color: #1e40af;
}

.kc-cookie-cat__check:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0px;
    width: 5px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.kc-cookie-cat__check:disabled {
    background: #e5e7eb;
    border-color: #cbd5e1;
    cursor: not-allowed;
    opacity: 0.7;
}

.kc-cookie-cat__check:disabled:checked {
    background: #94a3b8;
    border-color: #94a3b8;
}

.kc-cookie-cat__check:focus-visible {
    outline: 3px solid rgba(30, 64, 175, 0.25);
    outline-offset: 2px;
}

/* ----- Modal footer ----- */
.kc-cookie-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

@media (max-width: 480px) {
    .kc-cookie-modal__footer {
        flex-direction: column-reverse;
    }

    .kc-cookie-modal__footer .kc-btn {
        width: 100%;
    }
}

/* ----- Dark mode (system preference) ----- */
@media (prefers-color-scheme: dark) {
    .kc-cookie-banner__inner {
        background: #1f2937;
        color: #e5e7eb;
        box-shadow:
            0 20px 50px -10px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }

    .kc-cookie-banner__message {
        color: #d1d5db;
    }

    .kc-cookie-banner__message a {
        color: #60a5fa;
    }

    .kc-btn--secondary {
        background: #374151;
        color: #d1d5db;
        border-color: #374151;
    }

    .kc-btn--secondary:hover {
        background: #4b5563;
        color: #f3f4f6;
    }

    .kc-btn--ghost {
        color: #60a5fa;
        border-color: #60a5fa;
    }

    .kc-btn--ghost:hover {
        background: rgba(96, 165, 250, 0.1);
    }

    .kc-cookie-modal__panel {
        background: #1f2937;
        color: #e5e7eb;
    }

    .kc-cookie-modal__header {
        border-bottom-color: #374151;
    }

    .kc-cookie-modal__header h3 {
        color: #f9fafb;
    }

    .kc-cookie-modal__intro {
        color: #9ca3af;
    }

    .kc-cookie-cat {
        border-color: #374151;
    }

    .kc-cookie-cat__title {
        color: #f3f4f6;
    }

    .kc-cookie-cat__desc {
        color: #9ca3af;
    }

    .kc-cookie-modal__footer {
        background: #111827;
        border-top-color: #374151;
    }

    .kc-switch__slider {
        background: #4b5563;
    }
}
