/* Download Gateway Popup Styles */
/* Ported from Next.js project */

.gateway-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

.gateway-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.gateway-modal {
    background-color: #1a1a1a;
    border-radius: 16px;
    width: 95%;
    max-width: 650px;
    /* Increased for PC */
    padding: 0 24px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

.gateway-overlay.active .gateway-modal {
    transform: translateY(0);
}

.gateway-header {
    text-align: center;
    margin-bottom: 20px;
    margin-top: 24px;
    padding-top: 0;
}

.gateway-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 0;
}

.gateway-description {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.gateway-groups-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.gateway-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Domestic Group (First Child) */
.gateway-group.domestic {
    background: linear-gradient(145deg, rgba(249, 115, 22, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
    border-color: rgba(249, 115, 22, 0.15);
}

/* International Group (Second Child) */
.gateway-group.international {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.05) 0%, rgba(59, 130, 246, 0.02) 100%);
    border-color: rgba(59, 130, 246, 0.15);
}

.gateway-group-header {
    margin-bottom: 4px;
}

.gateway-group-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    opacity: 0.95;
    line-height: 1.5;
    color: #fff;
    display: flex;
    align-items: center;
}

.gateway-group-description {
    font-size: 12px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 8px;
}

.gateway-toggle-icon {
    display: none;
    /* Hide on Desktop */
}

.gateway-group-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gateway-action-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.gateway-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.gateway-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    /* Icon background */
    border-radius: 8px;
}

.gateway-btn-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    /* Enable truncation */
}

.gateway-btn-top {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    flex-wrap: wrap;
    /* Allow wrap on very small screens, but row on PC */
}

.gateway-btn-main {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-right: 6px;
    line-height: 1.4;
}

.gateway-btn-tag {
    font-size: 12px;
    margin-right: 0;
    background: rgba(255, 255, 255, 0.1);
    padding: 0 4px;
    border-radius: 4px;
    height: 18px;
    line-height: 18px;
    display: inline-flex;
    align-items: center;
}

.gateway-btn-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gateway-btn-sub::before {
    content: '';
    /* Remove parenthesis styling */
}

.gateway-btn-sub::after {
    content: '';
    /* Remove parenthesis styling */
}

.gateway-footer-note {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 10px;
    margin-bottom: 16px;
}

.gateway-close-button {
    width: 100%;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.gateway-close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.gateway-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
}

.gateway-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: gatewaySpin 1s linear infinite;
    margin: 0 auto 16px;
}

.gateway-error {
    color: #ef4444;
    text-align: center;
    padding: 24px;
}

@keyframes gatewayFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes gatewaySpin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Styles */
@media (max-width: 640px) {
    .gateway-groups-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gateway-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .gateway-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 24px 20px 30px;
        /* Safe area handled by bottom padding */
        max-height: 85vh;
        border-bottom: none;
        margin-bottom: 0;
        transform: translateY(100%);
    }

    .gateway-overlay.active .gateway-modal {
        transform: translateY(0);
    }

    .gateway-group-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
        /* Slightly more space on mobile */
    }

    .gateway-toggle-icon {
        display: block;
        /* Show on mobile */
        transition: transform 0.3s ease;
        font-size: 12px;
        color: rgba(255, 255, 255, 0.4);
    }

    .gateway-toggle-icon.expanded {
        transform: rotate(180deg);
    }

    .gateway-btn-icon {
        width: 28px;
        height: 28px;
        margin-right: 12px;
    }

    .gateway-action-btn {
        padding: 12px;
    }
}