/* Popup Styles */
.custom-popup-overlay, .popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(43, 29, 22, 0.9) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    backdrop-filter: blur(10px);
}

.custom-popup-overlay.show, .popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-popup-content {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.4),
        0 10px 10px -5px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.custom-popup-overlay.show .custom-popup-content {
    transform: scale(1) translateY(0);
}

.custom-popup-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.custom-popup-message {
    font-size: 1rem;
    color: #cccccc;
    margin: 0;
    line-height: 1.6;
    font-weight: 400;
}

.custom-popup-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #3d3d3d 0%, #2a2a2a 100%);
    color: #ffffff;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.custom-popup-input:focus {
    outline: none;
    border-color: var(--primary-color, #ff6600);
    background: linear-gradient(135deg, #4d4d4d 0%, #3a3a3a 100%);
    box-shadow: 
        0 0 0 3px rgba(var(--primary-color-rgb), 0.2),
        0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.custom-popup-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

.custom-popup-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.custom-popup-hint {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1.4;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
}

.custom-popup-hint i {
    font-size: 0.9rem;
    color: #888;
}

.custom-popup-btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 120px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.custom-popup-btn.primary {
    background: linear-gradient(135deg, var(--primary-color, #ff6600) 0%, rgba(var(--primary-color-rgb), 0.7) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
}

.custom-popup-btn.secondary {
    background: linear-gradient(135deg, #444444 0%, #333333 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Username-specific styles */
.custom-popup-content.username-popup {
    border-top: 4px solid var(--primary-color, #ff6600);
}

.custom-popup-content.username-popup .custom-popup-title {
    color: var(--primary-color, #ff6600);
}

/* Universal Close Button (Cross) for all Popups */
.close-btn, .modal-close-btn, .close-modal-btn, .ex-close-popup-btn, .close-overlay-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent !important;
    border: none !important;
    color: #888 !important;
    font-size: 22px !important;
    cursor: pointer !important;
    z-index: 1000 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: color 0.2s ease !important;
    transform: none !important;
}

.close-btn:hover, .modal-close-btn:hover, .close-modal-btn:hover, .ex-close-popup-btn:hover,
.close-btn:active, .modal-close-btn:active, .close-modal-btn:active, .ex-close-popup-btn:active {
    color: #ff4444 !important;
    transform: none !important;
    background: transparent !important;
}

.close-btn i, .modal-close-btn i, .close-modal-btn i, .ex-close-popup-btn i {
    transition: none !important;
    transform: none !important;
}

/* Responsive design */
@media (max-width: 480px) {
    .custom-popup-content {
        padding: 2rem 1.5rem;
        margin: 0 10px;
        width: 95%;
        max-width: 320px;
    }
    
    .custom-popup-title {
        font-size: 1.3rem;
    }
    
    .custom-popup-actions {
        flex-direction: column;
    }
    
    .custom-popup-btn {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 768px) and (min-width: 481px) {
    .custom-popup-content {
        padding: 2.2rem 1.8rem;
        max-width: 380px;
        width: 85%;
    }
    
    .custom-popup-title {
        font-size: 1.4rem;
    }
}

@media (min-width: 1200px) {
    .custom-popup-content {
        max-width: 420px;
        width: 80%;
        padding: 2.8rem;
    }
    
    .custom-popup-title {
        font-size: 1.6rem;
    }
}

@media (min-width: 1600px) {
    .custom-popup-content {
        max-width: 450px;
        width: 75%;
        padding: 3rem;
    }
    
    .custom-popup-title {
        font-size: 1.7rem;
    }
}
