/* Advanced Popup 360 - Clean and Safe CSS */

/* Główny popup - overlay */
.ap360-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.ap360-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ap360-popup-container {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    background: transparent;
    border-radius: 8px;
    padding: 0;
    text-align: center;
}

.ap360-popup-content {
    position: relative;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.ap360-popup-image {
    max-width: 100%;
    max-height: 90vh;
    height: auto;
    width: auto;
    display: block;
    border-radius: 8px;
}

.ap360-popup-link {
    display: block;
    text-decoration: none;
    border: none;
    outline: none;
}

/* Przycisk zamknięcia głównego popup */
.ap360-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 1000000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    outline: none;
}

.ap360-close-button:hover,
.ap360-close-button:focus {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.ap360-close-button span {
    color: #333;
    line-height: 1;
    font-family: Arial, sans-serif;
    font-size: 24px;
}

/* Mały popup w rogu */
.ap360-small-popup-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999998;
    transition: transform 0.3s ease, opacity 0.3s ease;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ap360-small-popup-container:hover {
    transform: scale(1.05);
}

.ap360-small-popup-container.ap360-small-visible {
    display: block;
    opacity: 1;
    visibility: visible;
}

.ap360-small-popup-content {
    position: relative;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
}

.ap360-small-popup-link {
    display: block;
    text-decoration: none;
    border: none;
    outline: none;
}

/* Przycisk zamknięcia małego popup */
.ap360-small-close-button {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
    z-index: 999999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    outline: none;
    color: #333;
}

.ap360-small-popup-container:hover .ap360-small-close-button {
    opacity: 1;
    visibility: visible;
}

.ap360-small-close-button:hover,
.ap360-small-close-button:focus {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.ap360-small-close-button span {
    color: #333;
    line-height: 1;
    font-size: 12px;
    font-family: Arial, sans-serif;
}

/* Desktop version - prostokątny obraz */
.ap360-small-popup-desktop {
    display: block;
}

.ap360-small-popup-mobile {
    display: none; /* Ukryj zawsze - używamy tylko desktop version */
}

/* ZMIANA: Z koła na prostokąt */
.ap360-small-popup-image {
    width: 120px;           /* Szerszy prostokąt */
    height: 70px;           /* Niższy niż szerokość */
    border-radius: 8px;     /* Zaokrąglone rogi zamiast koła (50%) */
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
    cursor: pointer;
    display: block;
    outline: none;
}

.ap360-small-popup-placeholder {
    width: 120px;           /* Dopasowane do image */
    height: 70px;           /* Dopasowane do image */
    border-radius: 8px;     /* Prostokąt zamiast koła */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    border: 3px solid #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-family: Arial, sans-serif;
    user-select: none;
}

/* Mobile version - ukryte, nie używane */
.ap360-small-popup-button {
    display: none !important;
}

/* Media Queries - responsywność */
@media (max-width: 768px) {
    .ap360-popup-container {
        max-width: 95vw;
        max-height: 95vh;
        margin: 20px;
    }
    
    .ap360-close-button {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    /* ZMIANA: Na mobile TAKŻE pokaż desktop version (z obrazem) */
    .ap360-small-popup-desktop {
        display: block; /* Pokaż zawsze */
    }
    
    .ap360-small-popup-mobile {
        display: none; /* Ukryj zawsze */
    }
    
    /* ZMIANA: Zmniejsz rozmiar prostokąta z obrazem na mobile */
    .ap360-small-popup-image {
        width: 120px;           /* Mniejszy niż desktop (120px) */
        height: 55px;          /* Mniejszy niż desktop (70px) */
        border: 2px solid #fff; /* Cieńsza ramka */
    }
    
    .ap360-small-popup-placeholder {
        width: 120px;           /* Mniejszy niż desktop */
        height: 55px;          /* Mniejszy niż desktop */
        font-size: 14px;       /* Mniejszy tekst */
        border: 2px solid #fff; /* Cieńsza ramka */
    }
    
    .ap360-small-popup-container {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .ap360-popup-container {
        max-width: 98vw;
        max-height: 98vh;
        margin: 10px;
    }
    
    .ap360-small-popup-container {
        bottom: 10px;
        right: 10px;
    }
    
    /* Na bardzo małych ekranach jeszcze mniejszy prostokąt */
    .ap360-small-popup-image {
        width: 80px;           /* Jeszcze mniejszy */
        height: 50px;          /* Jeszcze mniejszy */
    }
    
    .ap360-small-popup-placeholder {
        width: 80px;           /* Jeszcze mniejszy */
        height: 50px;          /* Jeszcze mniejszy */
        font-size: 12px;       /* Jeszcze mniejszy tekst */
    }
}

/* Animacje */
@keyframes ap360-fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes ap360-slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ap360-popup-overlay.active .ap360-popup-container {
    animation: ap360-fadeIn 0.3s ease-out;
}

.ap360-small-popup-container.ap360-small-visible {
    animation: ap360-slideInUp 0.4s ease-out;
}

/* Zapobieganie konfliktom z innymi stylami */
.ap360-popup-overlay * {
    box-sizing: border-box;
}

.ap360-small-popup-container * {
    box-sizing: border-box;
}

/* Ukrycie scrollbara gdy popup jest aktywny */
body.ap360-no-scroll {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Dodatkowe zabezpieczenia dla niestandardowych theme */
.ap360-popup-overlay,
.ap360-small-popup-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    line-height: normal !important;
    text-align: left !important;
    direction: ltr !important;
}

/* Reset dla linków w popup */
.ap360-popup-link,
.ap360-small-popup-link {
    color: inherit !important;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Debug styles (tylko gdy debug jest włączony) */
.ap360-debug {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    z-index: 9999999;
    font-size: 12px;
    border-radius: 5px;
    font-family: monospace;
    max-width: 300px;
    word-wrap: break-word;
}

/* Stylowanie dla panelu administracyjnego */
.ap360-image-upload {
    margin-bottom: 20px;
}

.ap360-image-preview {
    margin-bottom: 10px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.ap360-image-preview img {
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 5px;
    max-width: 200px;
    height: auto;
    transition: border-color 0.2s ease;
}

.ap360-image-preview img:hover {
    border-color: #0073aa;
}

.ap360-upload-button {
    margin-right: 10px;
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.ap360-upload-button:hover {
    background: #005a87;
    border-color: #005a87;
}

.ap360-remove-button {
    color: #a00;
    border-color: #a00;
}

.ap360-remove-button:hover {
    color: #dc3232;
    border-color: #dc3232;
}

#ap360-reset-popup-cookies {
    background: #dc3232;
    border-color: #dc3232;
    color: white;
}

#ap360-reset-popup-cookies:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

/* Responsywność dla panelu administracyjnego */
@media screen and (max-width: 782px) {
    .ap360-image-preview img {
        max-width: 150px;
    }
    
    .ap360-upload-button,
    .ap360-remove-button {
        display: block;
        width: 100%;
        margin-bottom: 5px;
        margin-right: 0;
    }
} 