/* ============================================
   OPTIMIZED DISCORD POPUP - MOBILE FRIENDLY
   Max 35% screen coverage, SEO compliant
   ============================================ */

.discord-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.discord-popup.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.discord-popup.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Optimized popup content - max 35% screen coverage */
.discord-popup-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: 2px solid #5865F2;
    border-radius: 12px;
    max-width: 380px;
    width: 85%;
    max-height: 70vh;
    box-shadow: 0 8px 32px rgba(88, 101, 242, 0.4);
    animation: popupSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    will-change: transform, opacity;
}

@keyframes popupSlideIn {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Close button - more prominent */
.discord-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 22px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.discord-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #5865F2;
    transform: rotate(90deg) scale(1.1);
}

/* Compact header */
.discord-popup-header {
    background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
    color: white;
    padding: 20px 15px 15px;
    text-align: center;
    position: relative;
}

.discord-popup-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="discord-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23discord-pattern)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

.discord-popup-header i {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
    position: relative;
    z-index: 1;
}

.discord-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-family: 'Cinzel', serif;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

/* Compact body */
.discord-popup-body {
    padding: 18px 20px;
    color: #e0e0e0;
    text-align: center;
    overflow-y: auto;
    max-height: 40vh;
}

.discord-popup-body p {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #ccc;
}

/* Compact benefits list */
.discord-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.discord-benefits li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: #ddd;
}

.discord-benefits i {
    color: #5865F2;
    font-size: 11px;
    width: 14px;
    flex-shrink: 0;
}

/* Compact footer */
.discord-popup-footer {
    padding: 15px 20px 18px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Optimized buttons */
.discord-join-btn {
    background: linear-gradient(135deg, #5865F2, #4752C4);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
    position: relative;
    overflow: hidden;
}

.discord-join-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.discord-join-btn:hover::before {
    left: 100%;
}

.discord-join-btn:hover {
    background: linear-gradient(135deg, #4752C4, #3c45a3);
    box-shadow: 0 6px 20px rgba(88, 101, 242, 0.5);
    transform: translateY(-2px);
}

.discord-join-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.4);
}

.discord-close-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.discord-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    .discord-popup-content {
        max-width: 90%;
        width: 90%;
        max-height: 60vh;
    }

    .discord-popup-header {
        padding: 15px 12px 12px;
    }

    .discord-popup-header i {
        font-size: 24px;
        margin-bottom: 6px;
    }

    .discord-popup-header h3 {
        font-size: 18px;
    }

    .discord-popup-body {
        padding: 15px;
        max-height: 35vh;
    }

    .discord-popup-body p {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .discord-benefits li {
        font-size: 12px;
        padding: 5px 0;
    }

    .discord-popup-footer {
        padding: 12px 15px 15px;
        gap: 10px;
    }

    .discord-join-btn,
    .discord-close-btn {
        padding: 9px 16px;
        font-size: 13px;
        flex: 1;
        justify-content: center;
    }

    .discord-popup-close {
        font-size: 20px;
        width: 28px;
        height: 28px;
        top: 8px;
        right: 12px;
    }
}

@media (max-width: 480px) {
    .discord-popup-content {
        max-width: 95%;
        max-height: 55vh;
    }

    .discord-popup-body {
        max-height: 30vh;
    }

    .discord-benefits li {
        font-size: 11px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

.discord-popup-content,
.discord-join-btn,
.discord-close-btn,
.discord-popup-close {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

.discord-popup-content {
    transform: translateZ(0);
}

.discord-popup-body {
    contain: layout style paint;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #5865F2 rgba(255, 255, 255, 0.1);
}

.discord-popup-body::-webkit-scrollbar {
    width: 6px;
}

.discord-popup-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.discord-popup-body::-webkit-scrollbar-thumb {
    background: #5865F2;
    border-radius: 3px;
}

.discord-popup-body::-webkit-scrollbar-thumb:hover {
    background: #4752C4;
}
