/* =================================
   Modern Cookie Consent System
   Mobile-first, Glassmorphism UI
   ================================= */

/* Base Styles */
.cookie-consent * {
    box-sizing: border-box;
}

/* 1. FLOATING COOKIE BADGE - Sağ alt köşe */
.cookie-floating-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    
    padding: 12px 20px;
    cursor: pointer;
    
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark, #1a202c);
}

.cookie-floating-badge.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-floating-badge:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08);
}

.cookie-floating-badge .cookie-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 16px;
    filter: grayscale(0.3);
}

/* Dark theme */
[data-theme="dark"] .cookie-floating-badge {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light, #f7fafc);
}

[data-theme="dark"] .cookie-floating-badge:hover {
    background: rgba(30, 41, 59, 0.95);
}

/* 2. MODAL OVERLAY */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 3. MODAL CONTAINER */
.cookie-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.2),
        0 8px 25px rgba(0, 0, 0, 0.1);
    
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
}

.cookie-modal-overlay.show .cookie-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

[data-theme="dark"] .cookie-modal {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 4. MODAL HEADER */
.cookie-modal-header {
    padding: 30px 30px 0;
    text-align: center;
}

.cookie-modal-header .cookie-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    filter: grayscale(0.2);
}

.cookie-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text-dark, #1a202c);
}

.cookie-modal-header p {
    font-size: 16px;
    color: var(--text, #4a5568);
    margin: 0;
    line-height: 1.5;
}

[data-theme="dark"] .cookie-modal-header h2 {
    color: var(--text-light, #f7fafc);
}

[data-theme="dark"] .cookie-modal-header p {
    color: var(--text-muted, #a0aec0);
}

/* 5. MODAL BODY */
.cookie-modal-body {
    padding: 20px 30px;
}

/* 6. COOKIE CATEGORIES */
.cookie-categories {
    margin: 20px 0;
}

.cookie-category {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    
    transition: all 0.3s ease;
}

.cookie-category:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
}

[data-theme="dark"] .cookie-category {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .cookie-category:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-dark, #1a202c);
}

.cookie-category-title .icon {
    font-size: 18px;
}

[data-theme="dark"] .cookie-category-title {
    color: var(--text-light, #f7fafc);
}

.cookie-category-description {
    font-size: 13px;
    color: var(--text, #4a5568);
    line-height: 1.4;
    margin: 0;
}

[data-theme="dark"] .cookie-category-description {
    color: var(--text-muted, #a0aec0);
}

/* 7. TOGGLE SWITCH */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.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: #e2e8f0;
    border-radius: 24px;
    transition: all 0.3s ease;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: var(--primary, #3b82f6);
}

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

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

/* 8. MODAL FOOTER */
.cookie-modal-footer {
    padding: 0 30px 30px;
    display: flex;
    gap: 12px;
}

.cookie-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cookie-btn-primary {
    background: var(--primary, #3b82f6);
    color: white;
}

.cookie-btn-primary:hover {
    background: var(--primary-dark, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-dark, #1a202c);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

[data-theme="dark"] .cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light, #f7fafc);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.cookie-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 9. MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .cookie-floating-badge {
        bottom: 15px;
        left: 15px;
        border-radius: 12px;
        text-align: center;
        padding: 16px;
    }
    
    .cookie-modal {
        margin: 10px;
        border-radius: 16px;
        max-height: 85vh;
    }
    
    .cookie-modal-header {
        padding: 20px 20px 0;
    }
    
    .cookie-modal-header .cookie-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }
    
    .cookie-modal-header h2 {
        font-size: 20px;
    }
    
    .cookie-modal-body {
        padding: 15px 20px;
    }
    
    .cookie-modal-footer {
        padding: 0 20px 20px;
        flex-direction: column;
    }
    
    .cookie-category {
        padding: 12px;
    }
    
    .cookie-categories {
        margin: 15px 0;
    }
}

/* 10. ANIMATIONS */
@keyframes cookiePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cookie-floating-badge.pulse {
    animation: cookiePulse 2s infinite;
}

/* 11. LOADING STATE */
.cookie-btn.loading {
    pointer-events: none;
}

.cookie-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 12. ACCESSIBILITY */
.cookie-consent :focus {
    outline: 2px solid var(--primary, #3b82f6);
    outline-offset: 2px;
}

.cookie-consent [data-sr-only] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 13. PERFORMANCE - GPU acceleration */
.cookie-modal,
.cookie-floating-badge {
    will-change: transform, opacity;
}
