body {
    background-color: #0F172A;
    color: white;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.glass-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.3);
    border-radius: 10px;
}

.ripple-btn {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 600ms linear;
    background-color: rgba(255, 255, 255, 0.4);
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.bottom-nav-item {
    position: relative;
    transition: all 0.3s ease;
}

.bottom-nav-item.active {
    color: #22d3ee;
}

.bottom-nav-item.active i {
    color: #22d3ee;
    filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.6));
    transform: scale(1.1);
}

.bottom-nav-item.active span {
    font-weight: 600;
}

.bottom-nav-item:not(.active):hover {
    color: white;
}

.bottom-nav-item:not(.active):hover i {
    color: #22d3ee;
}

.icon-3d {
    filter: drop-shadow(2px 6px 10px rgba(0, 0, 0, 0.5));
    display: inline-block;
}

/* Khung chuyển đổi Trang SPA */
.page-tab {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.page-tab.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skeleton Loading Base */
.skeleton {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: shimmer 1.5s infinite linear;
}

/* Segmented Control / Inner Tab Slide */
.tab-slider {
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* QR Scan Line Animation */
.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #22d3ee;
    box-shadow: 0 0 10px #22d3ee, 0 0 20px #22d3ee;
    top: 0;
    left: 0;
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Glass Input Forms */
.glass-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    transition: all 0.3s ease;
}

.glass-input:focus {
    outline: none;
    border-color: #22d3ee;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

/* Custom Select */
select.glass-input option {
    background-color: #0F172A;
    color: white;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);
    opacity: 0;
    background: rgba(34, 211, 238, 0.9);
    color: #0F172A;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.4);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* --- PROFILE MENU & VIEWS --- */
.profile-menu-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile-menu-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}
.profile-menu-item.active {
    background: rgba(255, 255, 255, 0.08);
}

#menu-btn-account.active {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
}
#menu-btn-account.active .menu-icon-wrapper {
    background: rgba(34, 211, 238, 0.2);
    color: #22d3ee;
}

#menu-btn-history.active {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}
#menu-btn-history.active .menu-icon-wrapper {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

#menu-btn-password.active {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.2);
}
#menu-btn-password.active .menu-icon-wrapper {
    background: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}

#menu-btn-terms.active {
    border-color: rgba(234, 179, 8, 0.5);
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}
#menu-btn-terms.active .menu-icon-wrapper {
    background: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

/* --- ROTATING BORDER GLOW EFFECT --- */
.border-glow-wrapper {
    position: relative;
    padding: 2px; /* Border thickness */
    overflow: hidden;
    z-index: 1;
}

.border-glow-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        #22d3ee 1.5%,
        #22d3ee 4.5%,
        transparent 6%,
        transparent 50%,
        #8B5CF6 51.5%,
        #8B5CF6 54.5%,
        transparent 56%,
        transparent 100%
    );
    animation: rotate-glow 4s linear infinite;
    z-index: 0;
}

@keyframes rotate-glow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.border-glow-inner {
    position: relative;
    background: rgba(15, 23, 42, 0.93) !important; /* Slightly darker glass bg for contrast */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 2;
}

/* --- PURCHASE MODAL STYLES --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: 100%;
    max-width: 500px;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Spinner animation for auto-detect */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid #22d3ee;
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- ONLINE IPA SIGNER STYLING SYSTEM --- */
.upload-dropzone {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.upload-dropzone:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.upload-dropzone.dragover {
    background: rgba(34, 211, 238, 0.08);
    border-color: #22d3ee !important;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.2);
    transform: scale(0.98);
}
/* Scrollbar for console panel */
#signer-console::-webkit-scrollbar {
    width: 6px;
}
#signer-console::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
#signer-console::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
#signer-console::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}
