/* Cookie Consent Manager - Styles */

:root {
    --cookie-primary: #2563eb;
    --cookie-primary-hover: #1d4ed8;
    --cookie-secondary: #64748b;
    --cookie-secondary-hover: #475569;
    --cookie-bg: #ffffff;
    --cookie-overlay: rgba(0, 0, 0, 0.5);
    --cookie-border: #e2e8f0;
    --cookie-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

/* Wrapper główny */
.cookie-consent-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Główny banner */
.cookie-consent-banner {
    background: var(--cookie-bg);
    border-top: 1px solid var(--cookie-border);
    box-shadow: var(--cookie-shadow);
    max-width: 600px;
    margin: 0 auto 20px 20px;
    border-radius: 12px;
    animation: slideUp 0.4s ease-out;
}

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

.cookie-banner-content {
    padding: 24px;
}

/* Panel ustawień */
.cookie-consent-settings {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--cookie-bg);
    border-radius: 16px;
    box-shadow: var(--cookie-shadow);
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: fadeInScale 0.3s ease-out;
    z-index: 1000000;
}

@keyframes fadeInScale {
    from {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Overlay dla panelu ustawień */
.cookie-consent-wrapper.settings-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--cookie-overlay);
    z-index: 999998;
    animation: fadeIn 0.3s ease-out;
}

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

/* Header ustawień */
.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--cookie-border);
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
    transition: color 0.2s;
    padding: 4px;
}

.close-btn:hover {
    color: #1e293b;
}

/* Taby */
.settings-tabs {
    display: flex;
    border-bottom: 1px solid var(--cookie-border);
    padding: 0 24px;
    gap: 4px;
}

.tab-btn {
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s;
    font-size: 14px;
}

.tab-btn:hover {
    color: #1e293b;
}

.tab-btn.active {
    color: var(--cookie-primary);
    border-bottom-color: var(--cookie-primary);
}

/* Zawartość tabów */
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Kategorie cookie */
.cookie-category {
    background: #f8fafc;
    border: 1px solid var(--cookie-border);
    border-radius: 8px;
    padding: 16px;
}

.category-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

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

/* Toggle switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    cursor: pointer;
}

.toggle.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

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

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

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

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

.toggle.disabled .toggle-slider {
    background-color: var(--cookie-primary);
}

/* Lista ciasteczek */
.cookies-list {
    font-size: 14px;
}

.cookie-item {
    background: #f8fafc;
    border: 1px solid var(--cookie-border);
    border-radius: 6px;
    padding: 12px;
}

/* Footer ustawień */
.settings-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--cookie-border);
    flex-wrap: wrap;
}

/* Przyciski */
.btn-primary {
    background: var(--cookie-primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-primary:hover {
    background: var(--cookie-primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #1e293b;
    border: 2px solid var(--cookie-border);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-secondary:hover {
    border-color: var(--cookie-secondary);
    background: #f8fafc;
}

.btn-tertiary {
    background: white;
    color: #64748b;
    border: 2px solid var(--cookie-border);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-tertiary:hover {
    color: #1e293b;
    border-color: #cbd5e1;
}

/* Link do ponownego otwarcia */
.cookie-consent-reopen {
    color: var(--cookie-primary);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.cookie-consent-reopen:hover {
    color: var(--cookie-primary-hover);
}

/* Responsywność */
@media (max-width: 768px) {
    .cookie-consent-banner {
        margin: 0 10px 10px 10px;
        max-width: none;
    }
    
    .cookie-consent-settings {
        width: 95%;
        max-height: 90vh;
    }
    
    .cookie-banner-content,
    .settings-header,
    .settings-content,
    .settings-footer {
        padding: 16px;
    }
    
    .settings-footer {
        flex-direction: column;
    }
    
    .settings-footer button {
        width: 100%;
    }
    
    .tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .category-header {
        flex-direction: column;
    }
    
    .toggle-wrapper {
        align-self: flex-end;
    }
}

/* Scrollbar styling dla zawartości */
.settings-content::-webkit-scrollbar {
    width: 8px;
}

.settings-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.settings-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Prose styling dla polityki */
.prose {
    line-height: 1.6;
}

.prose h4,
.prose h5 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.prose p {
    margin-bottom: 0.75rem;
}

.prose ul {
    margin-bottom: 0.75rem;
}

.prose a {
    color: var(--cookie-primary);
    text-decoration: underline;
}

.prose a:hover {
    color: var(--cookie-primary-hover);
}
