/* Cookie Consent Banner Styles */
#cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #2C5F2D 0%, #3d7a3e 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#cookie-consent-banner.show {
    display: block;
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 300px;
}

.cookie-consent-text h4 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.cookie-consent-text p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.95;
}

.cookie-consent-text a {
    color: #FFE082;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-consent-text a:hover {
    color: #FFF;
}

.cookie-consent-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: #FFF;
    color: #2C5F2D;
}

.cookie-btn-accept:hover {
    background: #FFE082;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cookie-btn-decline {
    background: transparent;
    color: #FFF;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.cookie-btn-decline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #FFF;
}

.cookie-btn-settings {
    background: transparent;
    color: #FFE082;
    border: 2px solid #FFE082;
}

.cookie-btn-settings:hover {
    background: #FFE082;
    color: #2C5F2D;
}

/* Cookie Settings Modal */
#cookie-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow-y: auto;
    padding: 20px;
}

#cookie-settings-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-settings-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cookie-settings-header {
    background: linear-gradient(135deg, #2C5F2D 0%, #3d7a3e 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-settings-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.cookie-settings-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.cookie-settings-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cookie-settings-body {
    padding: 24px;
}

.cookie-category {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cookie-category-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2C5F2D;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-category-required {
    background: #e0e0e0;
    color: #666;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cookie-category-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 8px;
}

.cookie-toggle {
    position: relative;
    width: 52px;
    height: 28px;
}

.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: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #2C5F2D;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-settings-footer {
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-consent-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
    }
    
    .cookie-settings-content {
        margin: 10px;
    }
}

/* Cookie notice när footer inte visas (för utloggade) */
body:not(.logged-in) #cookie-consent-banner {
    bottom: 0;
}

/* Justering när footer är synlig */
body.logged-in #cookie-consent-banner {
    bottom: 0;
}
