/* Cookie Consent Popup - Modern, Smaller, Eye-Catchy Design */

/* Bottom Bar Style - Sleek & Modern */
.cookie-consent {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    background: rgba(15, 15, 23, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.2);
    z-index: 9999;
    transform: translateY(100px);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    max-width: 450px;
    margin: 0 auto;
}

.cookie-consent.show {
    transform: translateY(0);
    opacity: 1;
}

/* Light Mode Support */
.light-mode .cookie-consent {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.cookie-consent-content {
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Cookie Header with Icon */
.cookie-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.2rem;
}

.cookie-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3));
    animation: cookieWiggle 3s ease-in-out infinite;
}

@keyframes cookieWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.cookie-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

/* Cookie Text */
.cookie-text {
    margin: 0;
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
}

.cookie-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    border-bottom: 1px dotted transparent;
}

.cookie-text a:hover {
    border-bottom-color: var(--primary);
}

/* Buttons Container */
.cookie-buttons {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.2rem;
}

.cookie-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Accept Button - Gradient Style */
.cookie-btn-accept {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    flex: 1;
    justify-content: center;
}

.cookie-btn-accept:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Settings Button - Outline Style */
.cookie-btn-settings {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
    backdrop-filter: blur(4px);
}

.cookie-btn-settings:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* Sidebar Style - Right Side Modern */
.cookie-consent.sidebar {
    bottom: auto;
    top: 50%;
    right: 20px;
    left: auto;
    transform: translateX(50px) translateY(-50%);
    max-width: 380px;
    background: rgba(15, 15, 23, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(99, 102, 241, 0.2);
    opacity: 0;
}

.cookie-consent.sidebar.show {
    transform: translateX(0) translateY(-50%);
    opacity: 1;
}

.light-mode .cookie-consent.sidebar {
    background: rgba(255, 255, 255, 0.98);
}

/* Settings Modal - Modern Glassmorphic */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-content {
    background: var(--surface);
    border-radius: 28px;
    max-width: 480px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(99, 102, 241, 0.2);
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Header */
.cookie-settings-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 28px 28px 0 0;
}

.cookie-settings-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-settings-header h3::before {
    content: "🍪";
    font-size: 1.2rem;
}

.cookie-settings-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-settings-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Body */
.cookie-settings-body {
    padding: 1.5rem;
}

.cookie-option {
    margin-bottom: 1.2rem;
    padding: 0.8rem;
    background: var(--bg);
    border-radius: 16px;
    transition: all 0.2s;
}

.cookie-option:hover {
    transform: translateX(4px);
}

.cookie-option-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cookie-option-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-option-title::before {
    content: "✨";
    font-size: 0.9rem;
}

/* Modern Toggle Switch */
.cookie-option-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.cookie-option-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-option-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.4;
    margin-top: 0.3rem;
    padding-left: 1.2rem;
}

/* Modal Footer */
.cookie-settings-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.cookie-save-btn {
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.cookie-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Animation for new messages */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .cookie-consent {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .cookie-consent.sidebar {
        right: 10px;
        left: 10px;
        top: auto;
        bottom: 10px;
        transform: translateY(100px);
        max-width: none;
    }
    
    .cookie-consent.sidebar.show {
        transform: translateY(0);
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-btn {
        justify-content: center;
    }
    
    .cookie-settings-content {
        width: 95%;
        margin: 1rem;
    }
    
    .cookie-settings-header h3 {
        font-size: 1rem;
    }
    
    .cookie-option {
        padding: 0.6rem;
    }
}

/* Extra Small Devices */
@media screen and (max-width: 480px) {
    .cookie-consent-content {
        padding: 1rem;
    }
    
    .cookie-icon {
        font-size: 1.5rem;
    }
    
    .cookie-header h4 {
        font-size: 0.95rem;
    }
    
    .cookie-text {
        font-size: 0.75rem;
    }
    
    .cookie-btn {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Smooth hover effects */
.cookie-consent,
.cookie-btn,
.cookie-settings-close,
.cookie-save-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Optional: Pulse animation for accept button */
@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 8px 24px rgba(99, 102, 241, 0.5);
    }
}

.cookie-btn-accept {
    animation: gentlePulse 2s ease-in-out infinite;
}

.cookie-btn-accept:hover {
    animation: none;
}