/* Cookie Consent Banner Styles for Coder World */

:root {
    --cookie-bg: #ffffff;
    --cookie-text: #333333;
    --cookie-border: #eeeeee;
    --cookie-primary: #4f8cff;
    --cookie-success: #28a745;
    --cookie-overlay: rgba(0, 0, 0, 0.5);
}

/* Dark mode variables */
.dark-mode {
    --cookie-bg: #2a2a2a;
    --cookie-text: #e0e0e0;
    --cookie-border: #444444;
    --cookie-primary: #6495ed;
    --cookie-success: #3cb371;
    --cookie-overlay: rgba(0, 0, 0, 0.7);
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    background-color: var(--cookie-bg);
    color: var(--cookie-text);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: slideUp 0.5s forwards;
    border: 1px solid var(--cookie-border);
}

/* Animation keyframes */
@keyframes slideUp {
    from { transform: translate(-50%, 100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, 100%); opacity: 0; }
}

/* Cookie content layout */
.cookie-consent-banner .cookie-content {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.cookie-consent-banner .cookie-icon {
    font-size: 24px;
    color: var(--cookie-primary);
}

.cookie-consent-banner .cookie-text h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.cookie-consent-banner .cookie-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Cookie buttons */
.cookie-consent-banner .cookie-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-consent-banner .cookie-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cookie-consent-banner .customize-btn {
    background-color: transparent;
    border: 1px solid var(--cookie-primary);
    color: var(--cookie-primary);
}

.cookie-consent-banner .customize-btn:hover {
    background-color: rgba(79, 140, 255, 0.1);
}

.cookie-consent-banner .accept-all-btn {
    background-color: var(--cookie-primary);
    color: white;
}

.cookie-consent-banner .accept-all-btn:hover {
    background-color: var(--cookie-primary);
    filter: brightness(1.1);
}

.cookie-consent-banner .cookie-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--cookie-text);
    opacity: 0.7;
}

.cookie-consent-banner .cookie-close-btn:hover {
    opacity: 1;
}

/* Cookie preferences modal */
.cookie-preferences {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    background-color: var(--cookie-bg);
    color: var(--cookie-text);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 25px;
    z-index: 10000;
    border: 1px solid var(--cookie-border);
}

.cookie-preferences h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--cookie-border);
    padding-bottom: 15px;
}

.cookie-preferences .preference-group {
    margin-bottom: 15px;
}

.cookie-preferences .preference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--cookie-border);
}

.cookie-preferences .preference-info {
    flex: 1;
}

.cookie-preferences .preference-title {
    font-weight: 500;
    margin-bottom: 5px;
}

.cookie-preferences .preference-description {
    font-size: 13px;
    color: var(--cookie-text);
    opacity: 0.7;
}

/* Toggle switch */
.cookie-preferences .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

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

.cookie-preferences .toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.cookie-preferences .toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.cookie-preferences input:checked + .toggle-slider {
    background-color: var(--cookie-primary);
}

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

/* Preference buttons */
.cookie-preferences .preference-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.cookie-preferences .preference-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cookie-preferences .cancel-btn {
    background-color: transparent;
    border: 1px solid var(--cookie-border);
    color: var(--cookie-text);
}

.cookie-preferences .cancel-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.cookie-preferences .save-btn {
    background-color: var(--cookie-primary);
    color: white;
}

.cookie-preferences .save-btn:hover {
    filter: brightness(1.1);
}

/* Overlay */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--cookie-overlay);
    z-index: 9999;
}

/* Confirmation message */
.cookie-confirmation {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--cookie-success);
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Responsive styles */
@media (max-width: 768px) {
    .cookie-consent-banner {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        border-radius: 8px 8px 0 0;
    }
    
    .cookie-consent-banner .cookie-content {
        flex-direction: column;
    }
    
    @keyframes slideUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    
    @keyframes slideDown {
        from { transform: translateY(0); opacity: 1; }
        to { transform: translateY(100%); opacity: 0; }
    }
    
    .cookie-preferences {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }
}
