/**
 * KA Cookie Manager - Style frontend
 */

/* Banner cookies — zawsze wyśrodkowany dialog z przyciemnionym tłem (overlay).
   Wszystkie klasy pozycji (ka-cookie-bottom/top/...) są ignorowane wizualnie —
   pełnoekranowy overlay flexem centruje kartę .ka-cookie-container. */
.ka-cookie-banner {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    font-family: "Poppins-Regular", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* Karta banera */
.ka-cookie-container {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    padding: 32px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ka-cookie-modal-slide-in 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.ka-cookie-banner.ka-cookie-dark .ka-cookie-container {
    background: #2c3e50;
    color: #ecf0f1;
}

.ka-cookie-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 22px;
}

.ka-cookie-text {
    flex: 1;
}

.ka-cookie-text p {
    margin: 0 0 10px 0;
}

.ka-cookie-link {
    color: #005392;
    text-decoration: none;
    margin-right: 15px;
    font-weight: 500;
}

.ka-cookie-link:hover {
    color: #0066B2;
    text-decoration: underline;
}

.ka-cookie-banner.ka-cookie-dark .ka-cookie-link {
    color: #74b9ff;
}

.ka-cookie-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.ka-cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 100px;
}

.ka-cookie-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ka-cookie-btn.ka-cookie-primary {
    background: linear-gradient(90deg, #005392 0%, #007DDC 100%);
    color: #ffffff;
    box-shadow: 0 0 28px rgba(0, 0, 0, 0.20);
}

.ka-cookie-btn.ka-cookie-primary:hover {
    background: linear-gradient(90deg, #005392 0%, #007DDC 100%);
    box-shadow: 0 2px 40px rgba(0, 0, 0, 0.28);
}

.ka-cookie-btn:not(.ka-cookie-primary) {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.ka-cookie-btn:not(.ka-cookie-primary):hover {
    background: #e9ecef;
}

.ka-cookie-banner.ka-cookie-dark .ka-cookie-btn:not(.ka-cookie-primary) {
    background: #34495e;
    color: #ecf0f1;
    border-color: #4a5f7a;
}

.ka-cookie-banner.ka-cookie-dark .ka-cookie-btn:not(.ka-cookie-primary):hover {
    background: #4a5f7a;
}

/* Blokada scrolla strony, gdy baner lub modal jest otwarty */
body.ka-cookie-modal-open {
    overflow: hidden;
}

/* Modal */
.ka-cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ka-cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.ka-cookie-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: ka-cookie-modal-slide-in 0.3s ease;
}

@keyframes ka-cookie-modal-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ka-cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.ka-cookie-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #005392;
    font-family: "Poppins-Bold", -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ka-cookie-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.ka-cookie-modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.ka-cookie-modal-body {
    padding: 24px;
}

.ka-cookie-modal-body > p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 14px;
}

.ka-cookie-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ka-cookie-option {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.ka-cookie-option:hover {
    border-color: #005392;
    box-shadow: 0 2px 8px rgba(0, 83, 146, 0.1);
}

.ka-cookie-option-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    text-align: left;
}

/* Suwaki (toggle) — spójne z komponentem .cs-switch panelu Kreatywna System */
.ka-cookie-switch {
    position: relative;
    flex: 0 0 auto;
    width: 40px;
    height: 23px;
    display: inline-block;
    margin-top: 1px;
}

.ka-cookie-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.ka-cookie-switch__track {
    position: absolute;
    inset: 0;
    background: #cfd4da;
    border-radius: 99px;
    transition: background 0.15s ease;
}

.ka-cookie-switch__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 19px;
    height: 19px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease;
}

.ka-cookie-switch input:checked ~ .ka-cookie-switch__track {
    background: #005392;
}

.ka-cookie-switch input:checked ~ .ka-cookie-switch__track::after {
    transform: translateX(17px);
}

.ka-cookie-switch input:disabled {
    cursor: not-allowed;
}

.ka-cookie-switch input:disabled ~ .ka-cookie-switch__track {
    opacity: 0.6;
}

.ka-cookie-option-title {
    flex: 1;
}

.ka-cookie-option-title strong {
    display: block;
    font-size: 16px;
    color: #005392;
    margin-bottom: 2px;
}

.ka-cookie-required {
    font-size: 12px;
    color: #6c757d;
    font-weight: normal;
}

.ka-cookie-option p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

.ka-cookie-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Strona ustawień */
.ka-cookie-settings-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.ka-cookie-settings-container h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 32px;
    font-weight: 600;
}

.ka-cookie-settings-intro {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #005392;
}

.ka-cookie-current-settings {
    background: #e8f5e8;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #27ae60;
}

.ka-cookie-current-settings h2 {
    color: #27ae60;
    margin-top: 0;
    font-size: 20px;
}

.ka-cookie-current-settings ul {
    margin: 10px 0;
    padding-left: 20px;
}

.ka-cookie-current-settings li {
    margin-bottom: 5px;
}

.ka-cookie-settings-section {
    margin-bottom: 30px;
}

.ka-cookie-settings-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
}

.ka-cookie-settings-form .ka-cookie-options {
    margin-bottom: 30px;
}

.ka-cookie-settings-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.ka-cookie-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 40px;
}

.ka-cookie-info h2 {
    color: #2c3e50;
    margin-top: 0;
    font-size: 20px;
}

/* Responsywność */
@media (max-width: 768px) {
    .ka-cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .ka-cookie-text {
        min-width: auto;
    }
    
    .ka-cookie-buttons {
        justify-content: center;
    }
    
    .ka-cookie-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .ka-cookie-modal-footer {
        flex-direction: column;
    }
    
    .ka-cookie-modal-footer .ka-cookie-btn {
        width: 100%;
    }
    
    .ka-cookie-settings-actions {
        flex-direction: column;
    }
    
    .ka-cookie-settings-actions .ka-cookie-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ka-cookie-container {
        padding: 15px;
    }
    
    .ka-cookie-btn {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 80px;
    }
    
    .ka-cookie-modal-header,
    .ka-cookie-modal-body,
    .ka-cookie-modal-footer {
        padding: 15px;
    }
} 