/* ==========================================================================
   Seniya Topup - Mobile App-Like & Popup Modal UI System
   ========================================================================== */

/* Modal Backdrop */
.app-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(4, 7, 13, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.app-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.app-modal-card {
    background: linear-gradient(145deg, rgba(20, 28, 46, 0.95), rgba(11, 16, 26, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 35px rgba(255, 122, 0, 0.15);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 32px 28px;
    text-align: center;
    position: relative;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #f8fafc;
}

.app-modal-overlay.active .app-modal-card {
    transform: scale(1) translateY(0);
}

/* Modal Icons */
.app-modal-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.app-modal-icon-wrap.success {
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.app-modal-icon-wrap.confirm {
    background: rgba(255, 122, 0, 0.15);
    border: 2px solid rgba(255, 122, 0, 0.4);
    color: #ff7a00;
    box-shadow: 0 0 30px rgba(255, 122, 0, 0.3);
}

.app-modal-icon-wrap.error {
    background: rgba(244, 63, 94, 0.15);
    border: 2px solid rgba(244, 63, 94, 0.4);
    color: #f43f5e;
    box-shadow: 0 0 30px rgba(244, 63, 94, 0.3);
}

.app-modal-icon-wrap i {
    font-size: 32px;
}

.app-modal-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    color: #ffffff;
}

.app-modal-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Plan Preview Badge inside Confirm Modal */
.app-modal-plan-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.app-modal-plan-name {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
}

.app-modal-plan-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.app-modal-plan-price {
    font-size: 18px;
    font-weight: 800;
    color: #ff7a00;
}

/* API Key Copy Container in Success Modal */
.app-modal-key-box {
    background: #060911;
    border: 1px dashed rgba(255, 122, 0, 0.4);
    border-radius: 16px;
    padding: 16px;
    margin: 18px 0 24px;
    text-align: left;
    position: relative;
}

.app-modal-key-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.app-modal-key-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: #38bdf8;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.app-modal-copy-btn {
    background: rgba(255, 122, 0, 0.15);
    border: 1px solid rgba(255, 122, 0, 0.3);
    color: #ff7a00;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.app-modal-copy-btn:hover {
    background: #ff7a00;
    color: #fff;
}

/* Modal Actions */
.app-modal-actions {
    display: flex;
    gap: 12px;
}

.app-modal-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.app-modal-btn.primary {
    background: linear-gradient(135deg, #ff7a00, #e05e00);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(255, 122, 0, 0.4);
}

.app-modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 122, 0, 0.5);
}

.app-modal-btn.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.app-modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Floating Toast Notification */
.app-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    background: rgba(15, 21, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 14px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.app-toast.success i { color: #10b981; }
.app-toast.error i { color: #f43f5e; }
.app-toast.warning i { color: #f59e0b; }
.app-toast.info i { color: #38bdf8; }

/* ==========================================================================
   Mobile Native App-Like Bottom Navigation
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding-bottom: 84px !important; /* Space for bottom nav */
    }

    .mobile-app-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        height: 68px;
        background: rgba(11, 16, 26, 0.94);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 0 8px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .mobile-app-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #64748b;
        font-size: 11px;
        font-weight: 600;
        padding: 6px 12px;
        border-radius: 12px;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
    }

    .mobile-app-nav-item i {
        font-size: 18px;
        margin-bottom: 4px;
        transition: transform 0.2s ease;
    }

    .mobile-app-nav-item.active {
        color: #ff7a00;
    }

    .mobile-app-nav-item.active i {
        transform: translateY(-2px);
        filter: drop-shadow(0 0 10px rgba(255, 122, 0, 0.6));
    }

    .mobile-app-nav-item:active {
        transform: scale(0.92);
    }
}