/**
 * Cookie Consent Banner & Modal Styles
 * KVKK/GDPR Uyumlu Çerez Yönetimi
 */

/* ===== Banner ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: var(--modern-bg-elevated, #ffffff);
    border-top: 1px solid var(--modern-border, #e2e8f0);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    padding: 1.5rem;
    animation: cookieBannerSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom;
}

@keyframes cookieBannerSlideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-banner.hiding {
    animation: cookieBannerSlideDown 0.3s ease-out forwards;
}

@keyframes cookieBannerSlideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(100%);
    }
}

.cookie-banner-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.cookie-banner-content {
    flex: 1;
}

.cookie-banner-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: linear-gradient(135deg, #f36f21, #d35a1a);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
}

.cookie-banner-text {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cookie-banner-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--modern-text, #1e293b);
    margin-bottom: 0.25rem;
}

.cookie-banner-description {
    font-size: 0.875rem;
    color: var(--modern-text-muted, #64748b);
    line-height: 1.5;
    margin: 0;
}

.cookie-banner-description a {
    color: #f36f21;
    text-decoration: none;
    font-weight: 500;
}

.cookie-banner-description a:hover {
    text-decoration: underline;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.cookie-btn-primary,
.cookie-btn-pratik {
    background: linear-gradient(135deg, #f36f21, #d35a1a);
    color: #fff;
    box-shadow: 0 2px 8px rgba(243, 111, 33, 0.3);
}

.cookie-btn-primary:hover,
.cookie-btn-pratik:hover {
    background: linear-gradient(135deg, #d35a1a, #b84d16);
    box-shadow: 0 4px 12px rgba(243, 111, 33, 0.4);
    transform: translateY(-1px);
}

.cookie-btn-secondary {
    background: var(--modern-surface-muted, #f1f5f9);
    color: var(--modern-text, #1e293b);
    border: 1px solid var(--modern-border, #e2e8f0);
}

.cookie-btn-secondary:hover {
    background: var(--modern-surface-hover, #e2e8f0);
    border-color: #cbd5e1;
}

.cookie-btn-outline {
    background: transparent;
    color: #f36f21;
    border: 1px solid #f36f21;
}

.cookie-btn-outline:hover {
    background: rgba(243, 111, 33, 0.08);
}

/* ===== Modal ===== */
.cookie-modal .modal-dialog {
    max-width: 640px;
}

.cookie-modal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.cookie-modal .modal-header {
    border-bottom: 1px solid var(--modern-border, #e2e8f0);
    padding: 1.25rem 1.5rem;
}

.cookie-modal .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--modern-text, #1e293b);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cookie-modal .modal-title i {
    color: #f36f21;
    font-size: 1.5rem;
}

.cookie-modal .modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.cookie-modal .modal-footer {
    border-top: 1px solid var(--modern-border, #e2e8f0);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
}

/* ===== Category Cards ===== */
.cookie-category {
    background: var(--modern-surface, #f8fafc);
    border: 1px solid var(--modern-border, #e2e8f0);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category:hover {
    border-color: #cbd5e1;
}

.cookie-category.required {
    background: rgba(243, 111, 33, 0.04);
    border-color: rgba(243, 111, 33, 0.2);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--modern-text, #1e293b);
    margin-bottom: 0.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-category-name .badge {
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.25em 0.5em;
    background: #f36f21;
    color: #fff;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cookie-category-desc {
    font-size: 0.8125rem;
    color: var(--modern-text-muted, #64748b);
    line-height: 1.4;
    margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 26px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #f36f21, #d35a1a);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Cookie List (Expandable) */
.cookie-category-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--modern-border, #e2e8f0);
    display: none;
}

.cookie-category.expanded .cookie-category-details {
    display: block;
}

.cookie-category-toggle-btn {
    background: none;
    border: none;
    color: #f36f21;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.cookie-category-toggle-btn:hover {
    text-decoration: underline;
}

.cookie-category-toggle-btn i {
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.cookie-category.expanded .cookie-category-toggle-btn i {
    transform: rotate(180deg);
}

.cookie-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cookie-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem;
    background: var(--modern-bg, #fff);
    border-radius: 8px;
    font-size: 0.8125rem;
}

.cookie-item-name {
    font-weight: 600;
    color: var(--modern-text, #1e293b);
    font-family: monospace;
}

.cookie-item-purpose {
    color: var(--modern-text-muted, #64748b);
    margin-top: 0.125rem;
}

.cookie-item-duration {
    color: var(--modern-text-muted, #64748b);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .cookie-banner {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .cookie-banner-title {
    color: #f1f5f9;
}

[data-theme="dark"] .cookie-banner-description {
    color: #94a3b8;
}

[data-theme="dark"] .cookie-btn-secondary {
    background: #334155;
    color: #f1f5f9;
    border-color: #475569;
}

[data-theme="dark"] .cookie-btn-secondary:hover {
    background: #475569;
}

[data-theme="dark"] .cookie-modal .modal-content {
    background: #1e293b;
    color: #f1f5f9;
}

[data-theme="dark"] .cookie-modal .modal-header,
[data-theme="dark"] .cookie-modal .modal-footer {
    border-color: #334155;
}

[data-theme="dark"] .cookie-modal .modal-title {
    color: #f1f5f9;
}

[data-theme="dark"] .cookie-category {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .cookie-category:hover {
    border-color: #475569;
}

[data-theme="dark"] .cookie-category.required {
    background: rgba(243, 111, 33, 0.08);
    border-color: rgba(243, 111, 33, 0.3);
}

[data-theme="dark"] .cookie-category-name {
    color: #f1f5f9;
}

[data-theme="dark"] .cookie-category-desc {
    color: #94a3b8;
}

[data-theme="dark"] .cookie-category-details {
    border-color: #334155;
}

[data-theme="dark"] .cookie-item {
    background: #1e293b;
}

[data-theme="dark"] .cookie-item-name {
    color: #f1f5f9;
}

[data-theme="dark"] .cookie-toggle-slider {
    background-color: #475569;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .cookie-banner-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cookie-banner-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cookie-banner-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 20px;
        border-radius: 10px;
    }

    .cookie-banner-title {
        font-size: 0.9375rem;
    }

    .cookie-banner-description {
        font-size: 0.8125rem;
    }

    .cookie-banner-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    .cookie-modal .modal-dialog {
        margin: 0.5rem;
    }

    .cookie-modal .modal-body {
        max-height: 50vh;
    }

    .cookie-category {
        padding: 0.875rem 1rem;
    }

    .cookie-category-header {
        flex-wrap: wrap;
    }

    .cookie-category-name {
        font-size: 0.875rem;
    }

    .cookie-category-desc {
        font-size: 0.75rem;
    }
}

/* ===== Policy Page ===== */
.cookie-policy-section {
    margin-bottom: 2rem;
}

.cookie-policy-section:last-child {
    margin-bottom: 0;
}

.cookie-policy-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--modern-text, #1e293b);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-policy-title i {
    color: #f36f21;
}

.cookie-policy-text {
    font-size: 0.9375rem;
    color: var(--modern-text-muted, #64748b);
    line-height: 1.7;
}

.cookie-policy-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.cookie-policy-list li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: var(--modern-text-muted, #64748b);
}

.cookie-policy-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.875rem;
    width: 6px;
    height: 6px;
    background: #f36f21;
    border-radius: 50%;
}

/* Tercih Değiştir Butonu (Sabit) */
.cookie-settings-fab {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f36f21, #d35a1a);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(243, 111, 33, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.cookie-settings-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(243, 111, 33, 0.5);
}

@media (max-width: 768px) {
    .cookie-settings-fab {
        bottom: 80px; /* Mobile nav üstünde */
        left: 16px;
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}
