:root {
    --primary-color: #00d4ff;
    --secondary-color: #7c3aed;
    --warning-color: #f59e0b;
    --dark-bg: #0a0a0f;
    --card-bg: #12121a;
    --border-color: #2a2a3a;
}

body {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1a2e 100%);
    min-height: 100vh;
    color: #ffffff;
    font-family: "Segoe UI", system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 212, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
    animation: pulseGlow 8s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 212, 255, 0.03) 50%,
        transparent 100%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 2;
    animation: scanMove 10s linear infinite;
}

@keyframes scanMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

.main-content {
    flex: 1;
    position: relative;
    z-index: 10;
}

.navbar {
    background: rgba(18, 18, 26, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-link {
    color: #ffffff !important;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 4px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(0, 212, 255, 0.1);
}

.chain-nav {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.chain-nav::-webkit-scrollbar {
    display: none;
}

.chain-btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    color: #ffffff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

.chain-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.chain-btn:hover::before {
    left: 100%;
}

.chain-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.chain-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    color: white;
}

.main-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.main-card::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.main-card:hover::before {
    opacity: 0.5;
    animation: borderGlow 3s linear infinite;
}

.main-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(0, 212, 255, 0.15);
}

@keyframes borderGlow {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(45deg); }
}

.card-header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(124, 58, 237, 0.1));
    border-bottom: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0 !important;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn-primary-custom::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn-primary-custom:hover::before {
    left: 100%;
}

.btn-primary-custom:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 212, 255, 0.4);
}

.btn-primary-custom:active {
    transform: translateY(-2px) scale(0.98);
}

.btn-success-custom {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-success-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-warning-custom {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
}

.btn-warning-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.btn-outline-primary-custom {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 12px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary-custom:hover {
    background: var(--primary-color);
    color: white;
}

.form-control, .form-select {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    color: #ffffff;
    border-radius: 10px;
}

.form-control:focus, .form-select:focus {
    background: var(--dark-bg);
    border-color: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 0 0 0.2rem rgba(0, 212, 255, 0.25);
}

.address-table {
    background: var(--dark-bg);
    border-radius: 12px;
    overflow: hidden;
}

.address-table thead {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(124, 58, 237, 0.15));
}

.address-table th {
    border-bottom: 2px solid var(--border-color);
    color: var(--primary-color);
    font-weight: 600;
    padding: 16px 12px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.address-table td {
    border-bottom: 1px solid var(--border-color);
    padding: 14px 12px;
}

.address-table tbody tr {
    transition: background-color 0.2s ease;
}

.address-table tbody tr:hover {
    background-color: rgba(0, 212, 255, 0.05);
}

.address-table code {
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: normal;
    display: block;
    max-width: 100%;
    line-height: 1.5;
}

.copy-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    padding: 4px 12px;
    font-size: 12px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: var(--primary-color);
    color: white;
}

.glow-text {
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.security-alert {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.15));
    border: 1px solid var(--warning-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.security-alert i {
    color: var(--warning-color);
}

.lang-selector {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: #e0e0e0;
    border-radius: 8px;
    padding: 6px 12px;
}

.quick-count-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-count-btn:hover {
    background: var(--primary-color);
    color: white;
}

.token-btn {
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 2px;
}

.token-btn:hover, .token-btn.active {
    background: var(--secondary-color);
    color: white;
}

.function-tab {
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.function-tab button {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.function-tab button:hover {
    color: var(--primary-color);
}

.function-tab button.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.function-content {
    display: none;
}

.function-content.active {
    display: block;
}

.transfer-table {
    width: 100%;
}

.transfer-table td {
    padding: 8px 4px;
}

.transfer-row {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
}

footer {
    background: rgba(18, 18, 26, 0.95);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
    margin-top: 60px;
    position: relative;
    z-index: 10;
}

footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color);
}

footer p {
    color: #ffffff;
}

@media (max-width: 768px) {
    .chain-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .address-table {
        font-size: 12px;
    }
    
    .function-tab button {
        min-width: 80px;
        font-size: 13px;
        padding: 8px 10px;
    }
    
    footer {
        padding: 20px 0;
        margin-top: 40px;
    }
    
    footer a {
        font-size: 12px !important;
    }
    
    footer p {
        font-size: 11px;
    }
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(18, 18, 26, 0.98);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    display: none;
    z-index: 999;
    padding: 8px 0;
    padding-bottom: env(safe-area-inset-bottom, 8px);
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 12px;
    cursor: pointer;
    flex: 1;
    max-width: 100px;
}

.bottom-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.text-muted {
    color: #d0d0d0 !important;
}

.text-secondary {
    color: #e0e0e0 !important;
}

.cursor-pointer {
    cursor: pointer;
    transition: all 0.2s ease;
}

.cursor-pointer:hover {
    opacity: 0.8;
    filter: brightness(1.2);
}

.collapse .fa-chevron-down {
    transform: rotate(0deg);
}

.collapse.show .fa-chevron-down {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .navbar {
        display: none !important;
    }
    
    .bottom-nav {
        display: block;
    }
    
    .main-content {
        padding-bottom: 100px;
    }
    
    footer {
        margin-bottom: 70px;
    }
}
