/* Milet Consent Banner — Portal Brand Uyumlu
 *
 * Portal tasarım dili:
 *   accent:  #00ca4e (Milet yeşili) + linear-gradient(135deg, #00b769, #00ca4e)
 *   buttons: pill-shaped (border-radius: 99999px) — auth-social-btn pattern
 *   dark BG: #121212 / #191919 / #1c1c2a
 *   card:    yumuşak büyük border-radius (~20px), subtle border
 *   font:    Poppins
 *   shadow:  0 4px 15px rgba(0, 183, 105, 0.3) — yeşil glow
 *
 * KVKK uyumu: 4 kategori parçalı rıza, opt-in mekanizması, ARIA dialog. */

/* ---------- TOKENS — DEFAULT (LIGHT) ---------- */
.mc-banner,
.mc-modal-wrap {
    --mc-bg: #ffffff;
    --mc-surface: #f5f7fa;
    --mc-text: #2a2a3a;
    --mc-text-soft: #5a6378;
    --mc-text-muted: #8a93a6;
    --mc-border: rgba(0, 0, 0, 0.08);
    --mc-divider: rgba(0, 0, 0, 0.06);
    --mc-secondary-border: #d0d5dd;
    --mc-secondary-bg-hover: rgba(0, 202, 78, 0.06);
    --mc-toggle-off: #cbd1de;

    --mc-primary: #00ca4e;
    --mc-primary-dark: #00b769;
    --mc-primary-soft: rgba(0, 202, 78, 0.12);
    --mc-primary-gradient: linear-gradient(135deg, #00b769 0%, #00ca4e 100%);
    --mc-primary-gradient-hover: linear-gradient(135deg, #00ca4e 0%, #05e463 100%);
    --mc-primary-shadow: 0 4px 15px rgba(0, 183, 105, 0.28);
    --mc-primary-shadow-hover: 0 8px 25px rgba(0, 183, 105, 0.42);

    --mc-shadow-banner: 0 -8px 32px rgba(17, 25, 40, 0.1), 0 -1px 0 rgba(0, 0, 0, 0.05);
    --mc-shadow-modal: 0 24px 64px rgba(17, 25, 40, 0.18);
}

/* ---------- TOKENS — DARK
 * Portal `body.theme-dark`, ana site `body.active-dark-mode` kullanır.
 * İkisi de tutulur — bundle her iki ekosistemde de dark mode'a duyarlı.
 * BG değerleri portal'ın canlı renkleriyle eşit:
 *   body bg: #121212 (--bs-body-bg)
 *   card bg: #191919 (login Portal Giriş kartı, aynı tonda)
 * Banner ve modal portal card'larıyla aynı yüzeyde durur. */
body.theme-dark .mc-banner,
body.theme-dark .mc-modal-wrap,
body.active-dark-mode .mc-banner,
body.active-dark-mode .mc-modal-wrap {
    --mc-bg: #191919;
    --mc-surface: #1f1f1f;
    --mc-text: #E5E5E5;
    --mc-text-soft: #c2c2d9;
    --mc-text-muted: #8d92a8;
    --mc-border: rgba(255, 255, 255, 0.06);
    --mc-divider: rgba(255, 255, 255, 0.05);
    --mc-secondary-border: #4a4a55;
    --mc-secondary-bg-hover: rgba(255, 255, 255, 0.04);
    --mc-toggle-off: rgba(255, 255, 255, 0.14);

    --mc-shadow-banner: 0 8px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02);
    --mc-shadow-modal: 0 24px 80px rgba(0, 0, 0, 0.75);
}

/* ---------- BANNER (BOTTOM SHEET) ---------- */
.mc-banner {
    position: fixed;
    left: 50%;
    bottom: 24px;
    width: calc(100% - 48px);
    max-width: 880px;
    background: var(--mc-bg);
    color: var(--mc-text);
    border: 1px solid var(--mc-border);
    border-radius: 24px;
    box-shadow: var(--mc-shadow-banner);
    z-index: 9998;
    transform: translate(-50%, calc(100% + 48px));
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.55;
}

.mc-banner.mc-visible {
    transform: translate(-50%, 0);
}

.mc-banner-inner {
    padding: 24px 28px;
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}


.mc-banner-content {
    flex: 1 1 480px;
    min-width: 0;
}

.mc-banner-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px;
    color: var(--mc-text);
    letter-spacing: -0.01em;
}

.mc-banner-desc {
    font-size: 13.5px;
    color: var(--mc-text-soft);
    margin: 0 0 8px;
}

.mc-banner-desc strong {
    color: var(--mc-text);
    font-weight: 600;
}

/* Link rengi auth sayfasındaki "Üye ol" link'iyle aynı turkuaz (#1dffe6).
 * !important: app-dark.css'te `body.theme-dark a` (specificity 0,1,1) eşit
 * spec tie'da override ediyor — auth brand rengini korumak için zorunlu. */
.mc-banner-desc a {
    color: #1dffe6 !important;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.15s;
}

.mc-banner-desc a:hover {
    opacity: 0.85;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mc-banner-links {
    font-size: 12.5px;
    color: var(--mc-text-muted);
    margin: 0;
}

.mc-banner-links a {
    color: var(--mc-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.mc-banner-links a:hover {
    color: #05e463;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.mc-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-left: auto; /* wrap olunca actions yeni satırda sağa yaslı kalsın */
}

/* ---------- BUTTONS — Portal pill (.auth-social-btn pattern)
 * !important: app-dark.css'te `body.theme-dark button { border-radius: 0 }`
 * kuralı specificity (0,1,1) ile .mc-btn'i (0,1,0) override ediyor — pill
 * shape'i korumak için zorunlu. */
.mc-btn {
    appearance: none;
    border: 1px solid transparent;
    cursor: pointer;
    padding: 13px 26px;
    border-radius: 99999px !important;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.2;
    font-family: inherit;
    letter-spacing: 0.3px;
    transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s, transform 0.15s;
    white-space: nowrap;
    user-select: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mc-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--mc-primary-soft);
}

.mc-btn:active {
    transform: scale(0.98);
}

/* Primary — Yeşil gradient + glow (btn-premium pattern) */
.mc-btn-primary {
    background: var(--mc-primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: var(--mc-primary-shadow);
}

.mc-btn-primary:hover {
    background: var(--mc-primary-gradient-hover);
    transform: translateY(-1px);
    box-shadow: var(--mc-primary-shadow-hover);
    color: #fff;
}

.mc-btn-primary:active {
    transform: scale(0.98);
    box-shadow: var(--mc-primary-shadow);
}

/* Secondary — Transparent + border (auth-social-btn pattern) */
.mc-btn-secondary {
    background: transparent;
    border: 1px solid var(--mc-secondary-border);
    color: var(--mc-text);
}

.mc-btn-secondary:hover {
    background: var(--mc-secondary-bg-hover);
    border-color: var(--mc-text);
    transform: translateY(-1px);
}

/* Link — Pure text */
.mc-btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--mc-text-muted);
    padding: 12px 14px;
}

.mc-btn-link:hover {
    color: var(--mc-text-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- MODAL ---------- */
.mc-modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
}

.mc-modal-wrap.mc-visible {
    display: flex;
}

.mc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 16, 0.65);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    animation: mc-fade 0.3s ease-out;
}

@keyframes mc-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mc-modal {
    position: relative;
    background: var(--mc-bg);
    color: var(--mc-text);
    border-radius: 25px;
    border: 1px solid var(--mc-border);
    box-shadow: var(--mc-shadow-modal);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: mc-slide-up 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes mc-slide-up {
    from { opacity: 0; transform: translateY(28px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px 18px;
    border-bottom: 1px solid var(--mc-divider);
}

.mc-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.mc-modal-close {
    appearance: none;
    border: 1px solid transparent;
    background: transparent;
    color: var(--mc-text-muted);
    font-size: 22px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 12px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.mc-modal-close:hover {
    background: var(--mc-secondary-bg-hover);
    border-color: var(--mc-secondary-border);
    color: var(--mc-text);
}

.mc-modal-close:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--mc-primary-soft);
}

.mc-modal-body {
    padding: 8px 28px;
    overflow-y: auto;
    flex: 1;
}

.mc-modal-footer {
    display: flex;
    gap: 10px;
    padding: 18px 28px 22px;
    justify-content: flex-end;
    flex-wrap: wrap;
    border-top: 1px solid var(--mc-divider);
    align-items: center;
}

/* ---------- CATEGORY ROW ---------- */
.mc-category {
    padding: 18px 0;
    border-bottom: 1px solid var(--mc-divider);
}

.mc-category:last-child {
    border-bottom: none;
}

.mc-category-head {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 6px;
    cursor: pointer;
}

.mc-locked .mc-category-head {
    cursor: default;
}

.mc-category-title {
    flex: 1;
    min-width: 0;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--mc-text);
    letter-spacing: -0.005em;
}

.mc-category-desc {
    font-size: 12.5px;
    color: var(--mc-text-soft);
    line-height: 1.55;
    margin: 0 0 8px;
}

.mc-category-domains {
    display: inline-block;
    font-size: 11px;
    color: var(--mc-primary);
    background: var(--mc-primary-soft);
    padding: 3px 10px;
    border-radius: 99999px;
    font-weight: 500;
    line-height: 1.5;
    letter-spacing: 0.2px;
}

/* ---------- TOGGLE SWITCH ---------- */
.mc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
}

.mc-toggle-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 1;
}

.mc-toggle-input:disabled {
    cursor: default;
}

.mc-toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--mc-toggle-off);
    border-radius: 99999px;
    transition: background-color 0.25s;
}

.mc-toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mc-toggle-input:checked + .mc-toggle-slider {
    background: var(--mc-primary);
    box-shadow: 0 0 0 1px rgba(0, 202, 78, 0.4), 0 2px 8px rgba(0, 183, 105, 0.4);
}

.mc-toggle-input:checked + .mc-toggle-slider::before {
    transform: translateX(20px);
}

.mc-toggle-input:disabled + .mc-toggle-slider {
    background: var(--mc-primary);
    opacity: 0.55;
}

.mc-toggle-input:focus-visible + .mc-toggle-slider {
    box-shadow: 0 0 0 3px var(--mc-primary-soft);
}

/* ---------- MOBILE ---------- */
@media (max-width: 640px) {
    .mc-banner {
        bottom: 16px;
        width: calc(100% - 34px); /* login kartıyla birebir aynı (17px her yan) */
        border-radius: 20px;
        transform: translate(-50%, calc(100% + 32px));
    }

    .mc-banner.mc-visible {
        transform: translate(-50%, 0);
    }

    .mc-banner-inner {
        padding: 20px; /* 4 yönden eşit cömert padding */
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 14px;
    }

    .mc-banner-content {
        flex: 0 0 auto; /* desktop'taki 480px flex-basis'i sıfırla */
    }

    .mc-banner-title {
        font-size: 15px;
        margin-bottom: 4px;
    }

    .mc-banner-desc {
        font-size: 12.5px;
        margin-bottom: 0;
    }

    .mc-banner-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-left: 0; /* mobile'da sağa yaslama yok, full-width */
    }

    .mc-banner-actions .mc-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        padding: 10px 12px;
        font-size: 12.5px;
        letter-spacing: 0.1px;
    }

    .mc-banner-actions .mc-btn-primary {
        flex: 1 1 100%;
        order: 3;
        margin-top: 6px; /* üst satır butonlarından 8(gap) + 6 = 14px boşluk */
    }

    .mc-modal-wrap {
        padding: 0;
        align-items: flex-end;
    }

    .mc-modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 25px 25px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .mc-modal-footer {
        flex-direction: column-reverse;
    }

    .mc-modal-footer .mc-btn {
        width: 100%;
    }
}
