:root {
    --sje-tg: #26A5E4;
    --sje-vk: #0077FF;
    --sje-ok: #EE8208;
    --sje-w: #ffffff;
    --sje-b: #000000;
    --sje-t: #2c3e50;
    --sje-m: #7f8c8d;
    --sje-ov: rgba(0, 0, 0, 0.75);
    --sje-sh: 0 15px 35px rgba(0, 0, 0, 0.2);
    --sje-f: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --sje-r: 12px;
    --sje-br: 8px;
    --sje-spd: 0.4s;
}

/* ============================================
   OVERLAY
   ============================================ */
.sje-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sje-ov);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--sje-spd), visibility var(--sje-spd);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

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

/* ============================================
   POPUP CONTENT
   ============================================ */
.sje-popup-content {
    background: var(--sje-w);
    padding: 32px;
    border-radius: var(--sje-r);
    width: 90%;
    max-width: 380px;
    position: relative;
    box-shadow: var(--sje-sh);
    font-family: var(--sje-f);
    text-align: center;
    box-sizing: border-box;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

/* Overlay layer for background darkening */
.sje-overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 1;
    pointer-events: none;
}

/* ============================================
   CLOSE BUTTON
   ============================================ */
.sje-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.sje-close:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.sje-text-light .sje-close {
    color: #ffffff;
}

.sje-text-light .sje-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   INNER WRAPPER & ALIGNMENT
   ============================================ */
.sje-inner-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.sje-align-left,
.sje-align-left .sje-body {
    align-items: flex-start;
    text-align: left;
}

.sje-align-center,
.sje-align-center .sje-body {
    align-items: center;
    text-align: center;
}

.sje-align-right,
.sje-align-right .sje-body {
    align-items: flex-end;
    text-align: right;
}

/* ============================================
   HEADER & SUBTITLE
   ============================================ */
.sje-header {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--sje-t);
    line-height: 1.3;
    width: 100%;
}

.sje-subtitle {
    font-size: 14px;
    color: var(--sje-m);
    margin-bottom: 16px;
    line-height: 1.5;
    width: 100%;
}

.sje-text-light .sje-header {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.sje-text-light .sje-subtitle {
    color: #eeeeee;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ============================================
   BODY & BUTTONS
   ============================================ */
.sje-body {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.sje-plate {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    text-decoration: none !important;
    color: #fff !important;
    border-radius: var(--sje-br);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.sje-plate:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sje-plate:active {
    transform: translateY(0);
}

.sje-plate svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    flex-shrink: 0;
}

.sje-tg {
    background: linear-gradient(135deg, var(--sje-tg) 0%, #1e8bc3 100%);
}

.sje-vk {
    background: linear-gradient(135deg, var(--sje-vk) 0%, #0055cc 100%);
}

.sje-ok {
    background: linear-gradient(135deg, var(--sje-ok) 0%, #cc6d00 100%);
}

/* ============================================
   FOOTER
   ============================================ */
.sje-footer {
    font-size: 13px;
    color: var(--sje-m);
    margin-top: 16px;
    width: 100%;
}

.sje-text-light .sje-footer {
    color: #cccccc;
}

/* ============================================
   GDPR CHECKBOX
   ============================================ */
.sje-gdpr-wrapper {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--sje-m);
}

.sje-gdpr-wrapper label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.sje-gdpr-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--sje-tg);
}

.sje-text-light .sje-gdpr-wrapper {
    color: #dddddd;
}

/* ============================================
   POSITION VARIANTS
   ============================================ */
.sje-pos-center {
    margin: 0 auto;
}

.sje-pos-bottom_right {
    position: fixed;
    bottom: 20px;
    right: 20px;
    left: auto;
    max-width: 340px;
    margin: 0;
}

.sje-pos-bottom_left {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: auto;
    max-width: 340px;
    margin: 0;
}

.sje-pos-sticky_bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
}

.sje-pos-sticky_bar .sje-inner-wrapper {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.sje-pos-sticky_bar .sje-header {
    margin-bottom: 0;
    font-size: 18px;
}

.sje-pos-sticky_bar .sje-body {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.sje-pos-sticky_bar .sje-plate {
    max-width: 180px;
    padding: 10px 16px;
    font-size: 13px;
}

.sje-pos-sticky_bar .sje-footer,
.sje-pos-sticky_bar .sje-subtitle {
    display: none;
}

/* ============================================
   ANIMATIONS
   ============================================ */
/* Fade */
.sje-active.sje-animation-fade .sje-popup-content {
    opacity: 1;
    transition: opacity var(--sje-spd);
}

/* Slide */
.sje-active.sje-animation-slide .sje-popup-content {
    transform: translateY(0);
    opacity: 1;
    transition: transform var(--sje-spd), opacity var(--sje-spd);
}

.sje-animation-slide .sje-popup-content {
    transform: translateY(50px);
    opacity: 0;
}

/* Scale */
.sje-active.sje-animation-scale .sje-popup-content {
    transform: scale(1);
    opacity: 1;
    transition: transform var(--sje-spd), opacity var(--sje-spd);
}

.sje-animation-scale .sje-popup-content {
    transform: scale(0.8);
    opacity: 0;
}

/* Bounce */
@keyframes sjeBounce {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
    70% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.sje-active.sje-animation-bounce .sje-popup-content {
    animation: sjeBounce 0.6s ease-out both;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .sje-popup-content {
        padding: 24px 20px;
        max-width: 95%;
    }
    
    .sje-header {
        font-size: 20px;
    }
    
    .sje-pos-bottom_right,
    .sje-pos-bottom_left {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }
    
    .sje-pos-sticky_bar {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }
    
    .sje-pos-sticky_bar .sje-inner-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .sje-pos-sticky_bar .sje-body {
        width: 100%;
    }
    
    .sje-pos-sticky_bar .sje-plate {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .sje-popup-content {
        padding: 20px 16px;
    }
    
    .sje-header {
        font-size: 18px;
    }
    
    .sje-plate {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .sje-plate svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .sje-popup-overlay,
    .sje-popup-content,
    .sje-plate,
    .sje-close {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus styles */
.sje-plate:focus,
.sje-close:focus,
.sje-gdpr-wrapper input[type="checkbox"]:focus {
    outline: 2px solid var(--sje-vk);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .sje-plate {
        border: 2px solid currentColor;
    }
    
    .sje-close {
        border: 2px solid currentColor;
    }
}
