:root {
    --ecc-primary: #7c3aed;
    --ecc-light: #8b5cf6;
    --ecc-bg: #ede9fe;
    --ecc-border: #c4b5fd;
    --ecc-text: #1e1b2e;
    --ecc-muted: #6b7280;
    --ecc-gradient: linear-gradient(135deg, #7c3aed, #8b5cf6);
}

#ecc-container {
    position: fixed;
    z-index: 2147483647;
    bottom: 20px;
    left: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* TRIGGER BUTTON */
#ecc-trigger {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--ecc-gradient);
    border: none;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

#ecc-trigger svg {
    width: 24px;
    height: 24px;
}

.ecc-pulse-ring {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7);
    display: none;
}

#ecc-trigger.is-pulsing .ecc-pulse-ring {
    display: block;
    animation: eccPulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

.ecc-tooltip {
    position: absolute;
    left: 60px;
    background: #1e1b2e;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}
#ecc-trigger:hover .ecc-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* OVERLAY */
#ecc-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#ecc-overlay.ecc-show {
    display: block;
    opacity: 1;
}

/* POPUP BANNER */
#ecc-popup {
    display: none;
    position: absolute;
    bottom: 60px;
    left: 0;
    width: 340px;
    background: white;
    border: 1.5px solid var(--ecc-border);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.15);
    z-index: 20;
    overflow: hidden;
    padding: 24px;
    box-sizing: border-box;
}

#ecc-popup.ecc-show {
    display: block;
    animation: eccBounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#ecc-popup.ecc-hide {
    display: block;
    animation: eccSlideOut 0.4s ease forwards;
}

.ecc-top-line {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--ecc-gradient);
}

.ecc-card-bg {
    position: absolute;
    top: 0; right: 0;
    width: 150px; height: 150px;
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.15), transparent 70%);
    pointer-events: none;
}

#ecc-close {
    position: absolute;
    top: 12px; right: 12px;
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--ecc-muted);
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.ecc-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ecc-icon-wrapper {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--ecc-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}
.ecc-icon-wrapper svg { width: 20px; height: 20px; }

#ecc-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--ecc-text);
}

.ecc-body p {
    margin: 0 0 16px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--ecc-muted);
}
.ecc-body a {
    color: var(--ecc-primary);
    text-decoration: none;
    font-weight: 500;
}

#ecc-status-bar {
    background: var(--ecc-bg);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ecc-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
#ecc-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ccc;
}
#ecc-status-dot.accepted { background: #10b981; }
#ecc-status-dot.declined { background: #f59e0b; }

.ecc-footer {
    display: flex;
    gap: 10px;
}

/* BUTTONS */
.ecc-btn {
    flex: 1;
    padding: 10px 0;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    transition: all 0.2s ease;
    text-align: center;
}

.ecc-btn-outline {
    background: transparent;
    border: 1.5px solid var(--ecc-border);
    color: var(--ecc-primary);
}
.ecc-btn-outline:hover { background: var(--ecc-bg); }

.ecc-btn-gradient {
    background: var(--ecc-gradient);
    border: none;
    color: white;
}
.ecc-btn-gradient:focus-visible {
    box-shadow: 0 0 0 2px white, 0 0 0 4px #10b981;
}

/* ANIMATIONS */
@keyframes eccPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 12px rgba(124, 58, 237, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(124, 58, 237, 0); }
}

@keyframes eccBounceIn {
    0% { transform: translateY(40px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes eccSlideOut {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(20px); opacity: 0; }
}

@keyframes eccBounceInMobile {
    0% { transform: translate(-50%, 20px); opacity: 0; }
    100% { transform: translate(-50%, -50%); opacity: 1; }
}

@keyframes eccSlideOutMobile {
    0% { transform: translate(-50%, -50%); opacity: 1; }
    100% { transform: translate(-50%, -30%); opacity: 0; }
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 600px) {
    #ecc-popup {
        position: fixed; /* Odrywamy popup od małego kontenera */
        bottom: auto;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 90vw; /* Zmiana z 90% na 90vw (viewport width) - bierze szerokość ekranu */
        max-width: 340px;
    }
    #ecc-popup.ecc-show {
        animation: eccBounceInMobile 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }
    #ecc-popup.ecc-hide {
        animation: eccSlideOutMobile 0.4s ease forwards;
    }
}