/* ==========================================================================
   ZICZALZ WEB3 DIRECT WALLET CONNECT & DAPP STYLES (DARK OBSIDIAN & VIOLET SHADE)
   ========================================================================== */

/* Web3 Connect Button in Header & Cards */
.web3-connect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%) !important;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.88rem;
    padding: 9px 18px;
    border-radius: 9999px;
    border: 1px solid rgba(168, 85, 247, 0.4);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    white-space: nowrap;
}

.web3-connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 50%, #d946ef 100%) !important;
    color: #ffffff !important;
}

.web3-connect-btn.connected {
    background: #0d091a;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    color: #f8fafc !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    font-size: 0.86rem;
    border-radius: 9999px;
}

.web3-connect-btn.connected:hover {
    border-color: #c084fc;
    background: #170e2b;
    color: #ffffff !important;
}

/* User Account Profile Button in Header */
.user-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: #0d091a;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    color: #f8fafc;
    padding: 5px 14px 5px 6px;
    border-radius: 9999px;
    font-size: 0.86rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.user-account-btn:hover {
    border-color: #c084fc;
    background: #170e2b;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.user-avatar-badge-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0d091a;
    border: 1.5px solid #a855f7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.35);
    flex-shrink: 0;
    overflow: hidden;
}

.user-avatar-mini img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.avatar-online-dot,
.web3-connected-dot {
    display: none !important;
}

/* User Account Dropdown Wrapper & Submenu (Dark Theme) */
.web3-dropdown-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.web3-user-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 210px;
    width: 210px;
    background: #0d091a;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.7), 0 4px 12px rgba(124, 58, 237, 0.2);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 99999;
    box-sizing: border-box;
    animation: web3DropdownFade 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.web3-user-dropdown-menu.show {
    display: flex !important;
}

@keyframes web3DropdownFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.web3-dropdown-header {
    padding: 8px 12px 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #c084fc;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    margin-bottom: 4px;
    width: 100%;
    box-sizing: border-box;
}

.web3-dropdown-item {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.web3-dropdown-item:hover {
    background: rgba(168, 85, 247, 0.18);
    color: #d8b4fe;
}

.web3-dropdown-divider {
    height: 1px;
    background: rgba(168, 85, 247, 0.2);
    margin: 4px 0;
    width: 100%;
}

.web3-dropdown-logout {
    color: #f87171 !important;
}

.web3-dropdown-logout:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    color: #fca5a5 !important;
}

/* Web3 Modal Overlay (Dark Theme) */
.web3-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 4, 7, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    box-sizing: border-box;
}

.web3-modal-overlay.active {
    display: flex;
    animation: web3FadeIn 0.25s ease;
}

@keyframes web3FadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.web3-modal-card {
    background: #0d091a;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    position: relative;
    font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
    color: #f8fafc;
}

.web3-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.web3-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.web3-modal-title h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
}

.web3-gold-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.8);
}

.web3-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
}

.web3-modal-close:hover {
    color: #ffffff;
}

.web3-modal-body {
    padding: 24px;
}

.web3-modal-desc {
    font-size: 0.86rem;
    color: #e9d5ff;
    line-height: 1.5;
    margin-bottom: 20px;
}

.web3-wallet-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.web3-wallet-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background-color: #120c24;
    border: 1px solid rgba(168, 85, 247, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    color: #f8fafc;
}

.web3-wallet-option:hover {
    background-color: #1a1036;
    border-color: #c084fc;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.25);
}

.web3-wallet-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #090d16;
    border: 1px solid rgba(168, 85, 247, 0.2);
    flex-shrink: 0;
}

.web3-wallet-icon-box img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.web3-wallet-info {
    flex: 1;
}

.web3-wallet-info strong {
    display: block;
    font-size: 0.94rem;
    font-weight: 700;
    color: #ffffff;
}

.web3-wallet-info span {
    font-size: 0.78rem;
    color: #c084fc;
}

.web3-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.76rem;
    color: #94a3b8;
    border-top: 1px solid rgba(168, 85, 247, 0.2);
    padding-top: 16px;
}

.web3-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0d091a;
    color: #ffffff;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 100000;
}

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

.web3-toast-success {
    border-left: 4px solid #10b981;
}

.web3-toast-info {
    border-left: 4px solid #a855f7;
}

.web3-badge {
    background: rgba(168, 85, 247, 0.15);
    color: #e9d5ff;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.web3-notice-bar {
    background: #120c24;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.78rem;
    color: #e9d5ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.web3-notice-bar code {
    color: #c084fc;
    font-weight: 700;
    font-family: monospace;
}

/* ==========================================================================
   ZICZALZ WEB3 DAPP DASHBOARD (DARK OBSIDIAN & VIOLET SHADE)
   ========================================================================== */
.dapp-wrapper {
    background-color: #06080d;
    min-height: 85vh;
    padding: 36px 0 80px;
    font-family: var(--font-sans, 'Plus Jakarta Sans', -apple-system, sans-serif);
    width: 100%;
    color: #f8fafc;
}

.dapp-container,
.db-container {
    max-width: 1240px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.dapp-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.dapp-brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dapp-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: rgba(13, 9, 26, 0.6);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.dapp-brand-logo img {
    height: 38px;
    width: auto;
    max-width: 170px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(168, 85, 247, 0.4));
}

.dapp-brand-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.dapp-brand-subtitle {
    font-size: 0.82rem;
    color: #c084fc;
    margin-top: 2px;
}

.dapp-header-icons {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dapp-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0d091a;
    border: 1px solid rgba(168, 85, 247, 0.25);
    color: #e9d5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.dapp-icon-btn:hover {
    background: #1a1036;
    color: #c084fc;
    border-color: #a855f7;
}

.dapp-wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0d091a;
    border: 1px solid rgba(168, 85, 247, 0.35);
    padding: 6px 10px 6px 14px;
    border-radius: 9999px;
    font-size: 0.84rem;
    font-weight: 700;
    color: #f8fafc;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dapp-disconnect-icon,
.web3-disconnect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    cursor: pointer;
    font-size: 0.72rem;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-left: 2px;
}

.dapp-disconnect-icon:hover,
.web3-disconnect-btn:hover {
    background: #ef4444;
    color: #ffffff !important;
    border-color: #ef4444;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Dark User Details Card */
.dapp-user-card {
    background: #0d091a;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 18px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.dapp-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #0d091a;
    border: 1.5px solid #a855f7;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c084fc;
    font-size: 1.25rem;
}

.dapp-user-addr {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.dapp-user-balance {
    font-size: 0.84rem;
    color: #c084fc;
    margin-top: 2px;
}

/* Sponsor Card */
.dapp-section-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #c084fc;
    margin-bottom: 10px;
}

.dapp-input-box {
    width: 100%;
    background: #120c24;
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    margin-bottom: 14px;
    transition: all 0.2s ease;
}

.dapp-input-box:focus {
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.dapp-sponsor-found {
    background: #0d091a;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.dapp-sponsor-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dapp-sponsor-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.dapp-sponsor-id {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
}

.dapp-sponsor-wallet {
    font-size: 0.78rem;
    color: #c084fc;
}

.dapp-check-icon {
    color: #10b981;
    font-size: 1.25rem;
    font-weight: 800;
}

/* Package Card */
.dapp-package-input-wrap {
    position: relative;
    background: #120c24;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 14px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dapp-package-amount {
    font-size: 1.45rem;
    font-weight: 900;
    color: #ffffff;
    border: none;
    outline: none;
    background: transparent;
    width: 60%;
}

.dapp-package-badge-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dapp-max-badge {
    background: rgba(168, 85, 247, 0.2);
    color: #e9d5ff;
    border: 1px solid rgba(168, 85, 247, 0.4);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
}

.dapp-usdt-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #c084fc;
}

.dapp-balance-warning {
    font-size: 0.8rem;
    color: #f87171;
    margin-top: 6px;
    margin-bottom: 16px;
}

/* Package Pills Grid */
.dapp-pills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.dapp-pill-btn {
    background: #120c24;
    border: 1px solid rgba(168, 85, 247, 0.25);
    border-radius: 9999px;
    padding: 12px;
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.dapp-pill-btn:hover {
    border-color: #c084fc;
    color: #e9d5ff;
    transform: translateY(-1px);
}

.dapp-pill-btn.active {
    background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
    color: #ffffff !important;
    border-color: #a855f7 !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45);
}

/* Plan Details 3-Column Box */
.dapp-plan-box {
    background: #0d091a;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 18px;
    padding: 24px 18px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    margin-bottom: 26px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.dapp-plan-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dapp-plan-col:not(:last-child) {
    border-right: 1px solid rgba(168, 85, 247, 0.2);
}

.dapp-plan-col-lbl {
    font-size: 0.8rem;
    color: #c084fc;
    margin-bottom: 6px;
}

.dapp-plan-col-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
}

.dapp-plan-col-val.gold {
    color: #e9d5ff;
}

.dapp-plan-col-sub {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* CTA Main Button - Violet Gradient */
.dapp-main-cta {
    width: 100%;
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #c026d3 100%) !important;
    color: #ffffff !important;
    font-size: 1.05rem;
    font-weight: 900;
    padding: 16px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dapp-main-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 58, 237, 0.65);
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 50%, #d946ef 100%) !important;
}

/* Plan Model Navigation Tabs */
.dapp-plan-nav {
    display: flex;
    background: #0d091a;
    padding: 4px;
    border-radius: 14px;
    margin-bottom: 20px;
    gap: 4px;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

.dapp-plan-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dapp-plan-tab.active {
    background: linear-gradient(135deg, #7c3aed, #9333ea);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.dapp-plan-tab.active.tab-lightning {
    color: #ffffff;
}

.dapp-plan-tab.active.tab-brightening {
    color: #ffffff;
}

/* Binary Tree Canvas inside DApp */
.dapp-tree-card {
    background: #0d091a;
    border: 1.5px solid rgba(168, 85, 247, 0.35);
    border-radius: 16px;
    padding: 24px 16px;
    margin-top: 24px;
    color: #f8fafc;
    overflow-x: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.dapp-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .web3-connect-btn {
        padding: 6px 12px;
        font-size: 0.78rem;
    }
    
    .web3-connect-btn.connected {
        padding: 6px 10px;
        font-size: 0.78rem;
        gap: 5px;
    }

    .web3-user-dropdown-menu {
        right: 0;
        top: calc(100% + 8px);
        width: 200px;
        max-width: calc(100vw - 32px);
    }
    
    .dapp-header-bar {
        margin-bottom: 18px;
    }

    .dapp-brand-title {
        font-size: 1.15rem;
    }
}
