/**
 * Butik Dünyası - Professional Cookie Consent Styling
 * Clean, isolated, responsive CSS with glassmorphism & dark/light theme support.
 */

:root {
    --cc-bg: #ffffff;
    --cc-text-main: #0f172a;
    --cc-text-muted: #64748b;
    --cc-border: #e2e8f0;
    --cc-primary: #0f995d;
    --cc-primary-hover: #0c824e;
    --cc-primary-light: #ecfdf5;
    --cc-secondary-bg: #f8fafc;
    --cc-radius: 16px;
    --cc-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --cc-backdrop: rgba(15, 23, 42, 0.65);
    --cc-font-family: inherit;
}

/* Animations */
@keyframes ccSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ccFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ccPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

/* Root Wrapper */
#cc-root {
    font-family: var(--cc-font-family);
    color: var(--cc-text-main);
}
#cc-root.cc-hidden {
    display: none !important;
}

/* Floating Cookie Re-open Trigger Button */
.cc-trigger-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--cc-border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cc-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}
.cc-trigger-btn:hover {
    transform: scale(1.1) rotate(12deg);
    box-shadow: 0 20px 25px -5px rgba(15, 153, 93, 0.25);
    border-color: var(--cc-primary);
    background: var(--cc-primary-light);
}
.cc-trigger-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}
.cc-trigger-btn .cc-tooltip {
    position: absolute;
    left: 58px;
    white-space: nowrap;
    background: #0f172a;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.cc-trigger-btn:hover .cc-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Cookie Banner Container */
.cc-banner {
    position: fixed;
    z-index: 9999;
    padding: 16px;
    animation: ccSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Position Variants */
.cc-banner.cc-pos-bottom {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
}
.cc-banner.cc-pos-bottom-left {
    bottom: 16px;
    left: 16px;
    max-width: 480px;
    width: calc(100% - 32px);
}
.cc-banner.cc-pos-bottom-right {
    bottom: 16px;
    right: 16px;
    max-width: 480px;
    width: calc(100% - 32px);
}

/* Banner Content Card */
.cc-banner-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--cc-shadow);
    border-radius: var(--cc-radius);
    padding: 24px;
    margin: 0 auto;
    max-width: 1140px;
}

.cc-banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.cc-banner-icon {
    width: 28px;
    height: 28px;
    color: var(--cc-primary);
    flex-shrink: 0;
}
.cc-banner-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--cc-text-main);
    margin: 0;
    line-height: 1.3;
}
.cc-banner-desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--cc-text-muted);
    margin: 0 0 16px 0;
}
.cc-banner-desc a {
    color: var(--cc-primary);
    text-decoration: underline;
    font-weight: 600;
}
.cc-banner-desc a:hover {
    color: var(--cc-primary-hover);
}

/* Buttons Layout */
.cc-banner-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.cc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    outline: none;
    line-height: 1.2;
}

.cc-btn-primary {
    background: var(--cc-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 153, 93, 0.25);
}
.cc-btn-primary:hover {
    background: var(--cc-primary-hover);
    box-shadow: 0 6px 16px rgba(15, 153, 93, 0.35);
    transform: translateY(-1px);
}

.cc-btn-secondary {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}
.cc-btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.cc-btn-text {
    background: transparent;
    color: #64748b;
    padding: 10px 14px;
}
.cc-btn-text:hover {
    color: var(--cc-primary);
    background: var(--cc-primary-light);
}

/* Modal Overlay & Dialog */
.cc-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--cc-backdrop);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: ccFadeIn 0.25s ease forwards;
}
.cc-modal-backdrop.cc-hidden {
    display: none !important;
}

.cc-modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 680px;
    max-height: 88vh;
    border-radius: var(--cc-radius);
    box-shadow: var(--cc-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ccSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cc-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--cc-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}
.cc-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cc-text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cc-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cc-modal-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.cc-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.cc-modal-intro {
    font-size: 13.5px;
    color: var(--cc-text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Category Cards */
.cc-category-card {
    border: 1px solid var(--cc-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 14px;
    background: #ffffff;
    transition: border-color 0.2s ease;
}
.cc-category-card:hover {
    border-color: #cbd5e1;
}

.cc-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.cc-category-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cc-category-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--cc-text-main);
}
.cc-badge-required {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f1f5f9;
    color: #475569;
    padding: 3px 8px;
    border-radius: 6px;
}

.cc-category-desc {
    font-size: 13px;
    color: var(--cc-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Accordion Toggle */
.cc-cookie-details-btn {
    background: none;
    border: none;
    color: var(--cc-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0 0 0;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cc-cookie-details-btn:hover {
    text-decoration: underline;
}

.cc-cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 11.5px;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    display: none;
}
.cc-cookie-table.cc-open {
    display: table;
}
.cc-cookie-table th, .cc-cookie-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.cc-cookie-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
}
.cc-cookie-table td {
    color: #475569;
}

/* Custom iOS/Tailwind Style Toggle Switch */
.cc-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.cc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.cc-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #cbd5e1;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}
.cc-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.cc-switch input:checked + .cc-slider {
    background-color: var(--cc-primary);
}
.cc-switch input:checked + .cc-slider:before {
    transform: translateX(20px);
}
.cc-switch input:disabled + .cc-slider {
    background-color: #94a3b8;
    cursor: not-allowed;
}

/* Modal Footer */
.cc-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--cc-border);
    background: #f8fafc;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .cc-banner-actions, .cc-modal-footer {
        flex-direction: column;
    }
    .cc-btn {
        width: 100%;
    }
    .cc-banner-card {
        padding: 16px;
    }
    .cc-trigger-btn {
        bottom: 16px;
        left: 16px;
        width: 42px;
        height: 42px;
    }
}
