/* Główny kontener zakładki */
.x-floating-popup {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1000;
}

/* Ukryty checkbox do kontroli stanu */
.x-floating-popup .tab-toggle {
    display: none;
}

/* Etykieta zakładki - widoczna część */
.x-floating-popup .tab-label {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    background: #2c3e50;
    color: white;
    padding: 15px 8px;
    cursor: pointer;
    border-radius: 8px 0 0 8px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}

.x-floating-popup .tab-label:hover {
    background: #34495e;
    transform: translateX(-5px);
}

/* Zawartość zakładki */
.x-floating-popup .tab-content {
    position: absolute;
    right: 100%;
    top: 0;
    width: 250px;
    background: white;
    border-radius: 8px 0 0 8px;
    box-shadow: -10px 0 25px rgba(0,0,0,0.3);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    visibility: hidden;
}

/* Stan aktywny - zakładka wysunięta */
.x-floating-popup .tab-toggle:checked + .tab-label + .tab-content {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.x-floating-popup .tab-toggle:checked + .tab-label {
    transform: translateX(-120px);
}

/* Stylowanie zawartości */
.x-floating-popup .tab-inner {
    padding: 0px;
    height: auto;
    overflow: visible;
}

.x-floating-popup .tab-inner img {
    display: block;
    border: none;
}

/* Przycisk zamknięcia */
.x-floating-popup .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    color: #bbb;
    cursor: pointer;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.x-floating-popup .close-btn:hover {
    background: #f0f0f0;
    color: #e74c3c;
}

/* Responsywność */
@media (max-width: 768px) {
    .x-floating-popup .tab-content {
        width: 250px;
    }

    .x-floating-popup .tab-toggle:checked + .tab-label {
        transform: translateX(-120px);
    }

    .x-floating-popup .tab-inner {
        padding: 0px;
    }
}

@media (max-width: 480px) {
    .x-floating-popup .tab-content {
        width: 250px;
    }

    .x-floating-popup .tab-toggle:checked + .tab-label {
        transform: translateX(-120px);
    }
}

/* Animacje dla lepszego UX */
@keyframes slideIn {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.x-floating-popup .tab-toggle:checked + .tab-label + .tab-content .tab-inner > * {
    animation: slideIn 0.5s ease forwards;
}

/* Stylowanie scrollbara */
.x-floating-popup .tab-inner::-webkit-scrollbar {
    width: 6px;
}

.x-floating-popup .tab-inner::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.x-floating-popup .tab-inner::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.x-floating-popup .tab-inner::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}