/**
 * Çerez bildirimi — kurumsal glassmorphism (blurred, katmanlı cam)
 */

@keyframes cookie-enter {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
        filter: blur(6px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes cookie-glow-pulse {
    0%,
    100% {
        opacity: 0.55;
    }
    50% {
        opacity: 1;
    }
}

@keyframes cookie-border-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

@keyframes cookie-scan {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

#cookie-popup.cookie-consent-container {
    display: none;
    position: fixed !important;
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    right: max(24px, env(safe-area-inset-right, 0px));
    left: auto !important;
    top: auto !important;
    z-index: 2147483000;
    isolation: isolate;
    width: min(400px, calc(100vw - 32px));
    max-width: 400px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    border: none;
    box-shadow: none;
    color: #e8eef2;
    pointer-events: auto;
    animation: cookie-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Dış halka — animasyonlu gradient çerçeve */
.cookie-consent__glass {
    position: relative;
    padding: 1px;
    border-radius: 22px;
    background: linear-gradient(
        135deg,
        rgba(45, 212, 210, 0.65) 0%,
        rgba(255, 255, 255, 0.12) 28%,
        rgba(1, 177, 175, 0.35) 52%,
        rgba(255, 255, 255, 0.08) 72%,
        rgba(45, 212, 210, 0.5) 100%
    );
    background-size: 200% 200%;
    animation: cookie-border-flow 8s linear infinite;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 24px 64px rgba(0, 0, 0, 0.48),
        0 0 48px rgba(1, 177, 175, 0.12);
}

.cookie-consent__glass::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 21px;
    background: linear-gradient(
        180deg,
        rgba(10, 16, 28, 0.97) 0%,
        rgba(8, 12, 22, 0.98) 100%
    );
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    z-index: 0;
}

.cookie-consent__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
    animation: cookie-glow-pulse 4s ease-in-out infinite;
}

.cookie-consent__glow--tl {
    top: -20%;
    left: -10%;
    width: 55%;
    height: 55%;
    background: rgba(1, 177, 175, 0.12);
    opacity: 0.4;
}

.cookie-consent__glow--br {
    bottom: -25%;
    right: -8%;
    width: 45%;
    height: 45%;
    background: rgba(45, 212, 210, 0.1);
    opacity: 0.35;
    animation-delay: 1.2s;
}

.cookie-consent__scanline {
    display: none;
}

.cookie-consent__scanline::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(
        180deg,
        transparent,
        rgba(255, 255, 255, 0.04),
        transparent
    );
    animation: cookie-scan 6s ease-in-out infinite;
}

.cookie-consent__header,
.cookie-consent-container .cookie-message,
.cookie-consent-container .cookie-buttons,
.cookie-consent-container .cookie-link {
    position: relative;
    z-index: 2;
}

.cookie-consent__header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 22px 22px 0;
}

.cookie-consent__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 1.15rem;
    color: #00ece9;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0.04) 100%
        ),
        rgba(1, 177, 175, 0.12);
    border: 1px solid rgba(45, 212, 210, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 8px 20px rgba(1, 177, 175, 0.18);
}

.cookie-consent__eyebrow {
    margin: 0 0 4px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(45, 212, 210, 0.9);
}

.cookie-consent-container .cookie-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.cookie-consent-container .cookie-message {
    margin: 0;
    padding: 14px 22px 18px;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #e2e8f0;
    font-weight: 500;
}

.cookie-consent-container .cookie-buttons {
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0 22px;
}

#cookie-popup .cookie-btn {
    box-sizing: border-box;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.25;
    white-space: nowrap;
    border-radius: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    transition:
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease;
}

#cookie-popup .cookie-btn i {
    font-size: 0.85rem;
    flex-shrink: 0;
    color: inherit;
    -webkit-text-fill-color: currentColor;
}

#cookie-popup .cookie-btn--accept,
#accept-cookies {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: linear-gradient(135deg, #2dd4d2 0%, #01b1af 55%, #018a88 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 10px 28px rgba(1, 177, 175, 0.38) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

#cookie-popup .cookie-btn--accept:hover,
#accept-cookies:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 14px 32px rgba(1, 177, 175, 0.48) !important;
}

#cookie-popup .cookie-btn--reject,
#decline-cookies {
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

#cookie-popup .cookie-btn--reject:hover,
#decline-cookies:hover {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: rgba(255, 255, 255, 0.16) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-1px);
}

.cookie-consent-container .cookie-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 44px);
    margin: 16px 22px 20px;
    padding: 10px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(45, 212, 210, 0.95);
    text-decoration: none;
    transition: color 0.2s ease, gap 0.2s ease;
}

.cookie-consent-container .cookie-link i {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.cookie-consent-container .cookie-link:hover {
    color: #b8fff8;
}

.cookie-consent-container .cookie-link:hover i {
    transform: translateX(3px);
}

/* Açık tema — yüksek kontrast, okunaklı cam kart */
/* Cam yüzey theme-light-glass.css içinde */

body.light-mode .cookie-consent-container,
html[data-theme="light"] #cookie-popup.cookie-consent-container {
    color: #334155 !important;
}

body.light-mode .cookie-consent__eyebrow,
html[data-theme="light"] #cookie-popup .cookie-consent__eyebrow {
    color: #016967 !important;
    -webkit-text-fill-color: #016967 !important;
    font-weight: 700;
}

body.light-mode .cookie-consent-container .cookie-title,
html[data-theme="light"] #cookie-popup .cookie-title {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
}

body.light-mode .cookie-consent-container .cookie-message,
html[data-theme="light"] #cookie-popup .cookie-message {
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    font-weight: 500;
}

body.light-mode .cookie-consent-container .cookie-link,
body.light-mode .cookie-consent-container .cookie-link span,
body.light-mode .cookie-consent-container .cookie-link i,
html[data-theme="light"] #cookie-popup .cookie-link,
html[data-theme="light"] #cookie-popup .cookie-link span,
html[data-theme="light"] #cookie-popup .cookie-link i {
    color: #016967 !important;
    -webkit-text-fill-color: #016967 !important;
    font-weight: 600;
}

body.light-mode .cookie-consent-container .cookie-link:hover,
body.light-mode .cookie-consent-container .cookie-link:hover span,
html[data-theme="light"] #cookie-popup .cookie-link:hover,
html[data-theme="light"] #cookie-popup .cookie-link:hover span {
    color: #018a88 !important;
    -webkit-text-fill-color: #018a88 !important;
}

/* Aydınlık tema — yüksek kontrast buton metinleri */
html[data-theme="light"] #cookie-popup .cookie-btn--accept,
html[data-theme="light"] #accept-cookies,
body.light-mode #cookie-popup .cookie-btn--accept,
body.light-mode #accept-cookies {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: linear-gradient(135deg, #0d9488 0%, #01b1af 55%, #018a88 100%) !important;
    border: 1px solid #0f766e !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 8px 24px rgba(1, 177, 175, 0.35) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"] #cookie-popup .cookie-btn--accept i,
html[data-theme="light"] #accept-cookies i,
body.light-mode #cookie-popup .cookie-btn--accept i,
body.light-mode #accept-cookies i {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html[data-theme="light"] #cookie-popup .cookie-btn--reject,
html[data-theme="light"] #decline-cookies,
body.light-mode #cookie-popup .cookie-btn--reject,
body.light-mode #decline-cookies {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    background: #ffffff !important;
    border: 2px solid #334155 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1) !important;
    text-shadow: none;
}

html[data-theme="light"] #cookie-popup .cookie-btn--reject:hover,
html[data-theme="light"] #decline-cookies:hover,
body.light-mode #cookie-popup .cookie-btn--reject:hover,
body.light-mode #decline-cookies:hover {
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    background: #f1f5f9 !important;
    border-color: #1e293b !important;
}

/* mobile-lux (ana sayfa) açık gri mesaj override */
body.light-mode #cookie-popup .cookie-message,
html[data-theme="light"] #cookie-popup .cookie-message {
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
}

@media (max-width: 991px) {
    #cookie-popup.cookie-consent-container {
        bottom: max(14px, env(safe-area-inset-bottom, 0px));
        right: max(14px, env(safe-area-inset-right, 0px));
        left: max(14px, env(safe-area-inset-left, 0px));
        width: auto;
        max-width: none;
    }

    .cookie-consent-container .cookie-buttons {
        flex-direction: column;
    }

    .cookie-consent-container .cookie-buttons .cookie-btn {
        width: 100%;
    }

    .cookie-consent-container .cookie-link {
        width: calc(100% - 44px);
    }
}

@media (prefers-reduced-motion: reduce) {
    #cookie-popup.cookie-consent-container,
    .cookie-consent__glass,
    .cookie-consent__glow,
    .cookie-consent__scanline::after {
        animation: none !important;
    }

    #cookie-popup.cookie-consent-container {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
