/**
 * Cookie Consent Banner Styles
 * GDPR-kompatibel cookie consent-lösning
 */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white, #ffffff);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 3px solid var(--primary-color, #1e3c72);
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

.cookie-consent-content {
    max-width: var(--max-width, 1200px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 250px;
}

.cookie-consent-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 0.5rem;
}

.cookie-consent-text p {
    font-size: 0.9rem;
    color: var(--text-secondary, #666666);
    line-height: 1.5;
    margin: 0;
}

.cookie-consent-text a {
    color: var(--primary-color, #1e3c72);
    text-decoration: underline;
}

.cookie-consent-text a:hover {
    color: var(--primary-light, #2a5298);
}

.cookie-consent-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-consent-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    white-space: nowrap;
}

.cookie-consent-btn-accept {
    background: var(--primary-color, #1e3c72);
    color: white;
}

.cookie-consent-btn-accept:hover {
    background: var(--primary-light, #2a5298);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.cookie-consent-btn-reject {
    background: transparent;
    color: var(--text-primary, #1a1a1a);
    border: 2px solid var(--border-color, #e0e0e0);
}

.cookie-consent-btn-reject:hover {
    background: var(--bg-light, #f8f9fa);
    border-color: var(--text-secondary, #666666);
}

.cookie-consent-btn-settings {
    background: transparent;
    color: var(--text-secondary, #666666);
    text-decoration: underline;
    padding: 0.75rem 0.5rem;
}

.cookie-consent-btn-settings:hover {
    color: var(--primary-color, #1e3c72);
}

/* Reklam är alltid synlig (nödvändig för ideell verksamhet) */
/* Ingen CSS behövs för att dölja reklam eftersom den alltid ska visas */

/* Meddelande när användaren godkänt reklam men annonser troligen blockeras (t.ex. adblock) */
.adblock-whitelist-message {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white, #ffffff);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
    padding: 0.875rem 1.25rem;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 2px solid var(--primary-color, #1e3c72);
}

.adblock-whitelist-message-show {
    transform: translateY(0);
}

.adblock-whitelist-content {
    max-width: var(--max-width, 1200px);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.adblock-whitelist-text {
    flex: 1;
    min-width: 200px;
    font-size: 0.9rem;
    color: var(--text-secondary, #666666);
    line-height: 1.45;
    margin: 0;
}

.adblock-whitelist-dismiss {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    background: transparent;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-primary, #1a1a1a);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.adblock-whitelist-dismiss:hover {
    background: var(--bg-light, #f8f9fa);
    border-color: var(--text-secondary, #666666);
}

@media (max-width: 768px) {
    .adblock-whitelist-message {
        padding: 0.75rem 1rem;
    }
    .adblock-whitelist-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .adblock-whitelist-dismiss {
        align-self: center;
    }
}

/* Cookie-inställningsknapp i footer (valfritt) */
.cookie-settings-link {
    color: var(--text-secondary, #666666);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cookie-settings-link:hover {
    color: var(--primary-color, #1e3c72);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 1rem;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-consent-text {
        min-width: 100%;
    }
    
    .cookie-consent-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-consent-btn {
        width: 100%;
    }
}

/* Cookie settings modal */
.cookie-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-settings-modal.show {
    display: flex;
    opacity: 1;
}

.cookie-settings-content {
    background: var(--bg-white, #ffffff);
    border-radius: 16px;
    padding: 0;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-xl, 0 20px 48px rgba(0, 0, 0, 0.2));
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.cookie-settings-modal.show .cookie-settings-content {
    transform: scale(1);
}

.cookie-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.cookie-settings-header h2 {
    margin: 0;
    color: var(--text-primary, #1a1a1a);
    font-size: 1.5rem;
    font-weight: 600;
}

.cookie-settings-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary, #666666);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.cookie-settings-close:hover {
    background: var(--bg-light, #f8f9fa);
    color: var(--text-primary, #1a1a1a);
}

.cookie-settings-intro {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.cookie-settings-intro p {
    color: var(--text-secondary, #666666);
    margin: 0;
    line-height: 1.6;
}

.cookie-categories {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-light, #f8f9fa);
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: var(--border-color, #e0e0e0);
    box-shadow: var(--shadow, 0 4px 12px rgba(0, 0, 0, 0.08));
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.cookie-category-info {
    flex: 1;
}

.cookie-category-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary, #1a1a1a);
    font-size: 1.1rem;
    font-weight: 600;
}

.cookie-category-description {
    margin: 0;
    color: var(--text-secondary, #666666);
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-toggle-wrapper {
    flex-shrink: 0;
}

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    cursor: pointer;
}

.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.3s;
    border-radius: 28px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    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: var(--primary-color, #1e3c72);
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.2);
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: var(--primary-color, #1e3c72);
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-category-details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.cookie-category-details p {
    margin: 0.5rem 0;
    color: var(--text-secondary, #666666);
    font-size: 0.9rem;
}

.cookie-category-details ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding: 0;
    color: var(--text-secondary, #666666);
    font-size: 0.9rem;
    line-height: 1.6;
}

.cookie-category-details li {
    margin-bottom: 0.5rem;
}

.cookie-provider {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    font-size: 0.85rem;
    color: var(--text-light, #999999);
}

.cookie-settings-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-settings-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    flex: 1;
    min-width: 120px;
}

.cookie-settings-btn-primary {
    background: var(--primary-color, #1e3c72);
    color: white;
}

.cookie-settings-btn-primary:hover {
    background: var(--primary-light, #2a5298);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
}

.cookie-settings-btn-secondary {
    background: transparent;
    color: var(--text-primary, #1a1a1a);
    border: 2px solid var(--border-color, #e0e0e0);
}

.cookie-settings-btn-secondary:hover {
    background: var(--bg-light, #f8f9fa);
    border-color: var(--text-secondary, #666666);
}

.cookie-settings-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    background: var(--bg-light, #f8f9fa);
}

.cookie-settings-footer p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary, #666666);
    text-align: center;
}

.cookie-settings-footer a {
    color: var(--primary-color, #1e3c72);
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-settings-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .cookie-settings-header,
    .cookie-settings-intro,
    .cookie-categories,
    .cookie-settings-actions,
    .cookie-settings-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .cookie-category-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cookie-toggle-wrapper {
        align-self: flex-start;
    }
    
    .cookie-settings-actions {
        flex-direction: column;
    }
    
    .cookie-settings-btn {
        width: 100%;
    }
}

