/**
 * Cookie Consent Styling
 * Modern och tilltalande design för cookie consent modal
 * Version: 1.0.0
 */

/* Overlay för modal */
#cookieConsentModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Modal container */
.cookie-consent-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.cookie-consent-header {
    padding: 30px 30px 20px 30px;
    border-bottom: 1px solid #e5e7eb;
}

.cookie-consent-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-consent-header .cookie-icon {
    font-size: 28px;
}

.cookie-consent-header p {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
    line-height: 1.5;
}

/* Body */
.cookie-consent-body {
    padding: 25px 30px;
}

/* Simple view */
#cookieConsentSimple {
    display: block;
}

#cookieConsentSimple .cookie-info {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid #10b981;
}

#cookieConsentSimple .cookie-info p {
    margin: 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.6;
}

/* Settings view */
#cookieConsentSettings {
    display: none;
}

.cookie-category {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.cookie-category:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

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

.cookie-category-title {
    font-weight: 600;
    color: #111827;
    font-size: 16px;
    margin: 0;
}

.cookie-category-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.cookie-category.required {
    background: #fef3c7;
    border-color: #fbbf24;
}

.cookie-category.required .cookie-category-title {
    color: #92400e;
}

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

.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: #d1d5db;
    transition: 0.3s;
    border-radius: 34px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #10b981;
}

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

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

.required-badge {
    display: inline-block;
    background: #fbbf24;
    color: #92400e;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer buttons */
.cookie-consent-footer {
    padding: 20px 30px 30px 30px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-consent-footer button {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.cookie-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cookie-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.cookie-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.cookie-btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.cookie-btn-link {
    background: transparent;
    color: #10b981;
    padding: 8px 16px;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-btn-link:hover {
    color: #059669;
    background: #f0fdf4;
}

/* Back button i settings view */
.cookie-settings-back {
    margin-bottom: 20px;
}

.cookie-settings-back button {
    background: transparent;
    border: none;
    color: #10b981;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 0;
    font-weight: 500;
}

.cookie-settings-back button:hover {
    color: #059669;
}

/* Footer link för cookie settings */
#openCookieSettings {
    color: #10b981;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
}

#openCookieSettings:hover {
    color: #059669;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 640px) {
    .cookie-consent-container {
        max-width: 100%;
        margin: 0;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
    
    #cookieConsentModal {
        align-items: flex-end;
        padding: 0;
    }
    
    .cookie-consent-header {
        padding: 20px 20px 15px 20px;
    }
    
    .cookie-consent-header h2 {
        font-size: 20px;
    }
    
    .cookie-consent-body {
        padding: 20px;
    }
    
    .cookie-consent-footer {
        padding: 15px 20px 20px 20px;
        flex-direction: column;
    }
    
    .cookie-consent-footer button {
        width: 100%;
        min-width: auto;
    }
}

/* Custom scrollbar för modal */
.cookie-consent-container::-webkit-scrollbar {
    width: 8px;
}

.cookie-consent-container::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 0 16px 16px 0;
}

.cookie-consent-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.cookie-consent-container::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.cookie-icon {
    animation: pulse 2s ease-in-out infinite;
}
