/* Phantom Wallet Integration Styles */

:root {
    --phantom-purple: #AB9FF2;
    --phantom-dark: #2A2D47;
    --phantom-gradient: linear-gradient(135deg, #AB9FF2 0%, #7B68EE 100%);
}

/* Wallet Connection Button */
#phantomConnectBtn {
    background: var(--phantom-gradient);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(171, 159, 242, 0.3);
}

#phantomConnectBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(171, 159, 242, 0.4);
}

#phantomConnectBtn.connected {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

#phantomConnectBtn i {
    font-size: 1.1rem;
}

/* Wallet Info Section */
.wallet-connected-info {
    background: rgba(171, 159, 242, 0.1);
    border: 1px solid var(--phantom-purple);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
}

.wallet-address {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wallet-address .label {
    color: var(--text-secondary);
    font-weight: 500;
}

.wallet-address .address {
    font-family: 'Courier New', monospace;
    color: var(--phantom-purple);
    background: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--phantom-purple);
    color: var(--phantom-purple);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.disconnect-btn {
    background: transparent;
    border: 2px solid var(--error);
    color: var(--error);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.disconnect-btn:hover {
    background: var(--error);
    color: white;
}

/* Wallet Scan History Section */
#walletScanHistorySection {
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    display: none;
}

.wallet-scan-history h4 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
}

.wallet-scan-history h4 i {
    color: var(--phantom-purple);
}

.scan-history-item {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.scan-history-item:hover {
    border-color: var(--phantom-purple);
    box-shadow: 0 4px 15px rgba(171, 159, 242, 0.1);
}

.scan-info {
    flex: 1;
}

.scan-target {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.scan-target i {
    color: var(--phantom-purple);
}

.scan-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.scan-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.scan-type {
    background: rgba(171, 159, 242, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    color: var(--phantom-purple);
}

.scan-results {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.severity-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.severity-critical {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid #ff4444;
}

.severity-high {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid #ffaa00;
}

.severity-medium {
    background: rgba(255, 221, 0, 0.2);
    color: #ffdd00;
    border: 1px solid #ffdd00;
}

.severity-low {
    background: rgba(0, 255, 136, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.severity-info {
    background: rgba(0, 170, 255, 0.2);
    color: #00aaff;
    border: 1px solid #00aaff;
}

.view-scan-btn {
    background: var(--phantom-gradient);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.view-scan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(171, 159, 242, 0.3);
}

.no-scans-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-scans-message i {
    font-size: 3rem;
    color: var(--phantom-purple);
    margin-bottom: 1rem;
    display: block;
}

.no-scans-message p {
    margin: 0.5rem 0;
}

.text-muted {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Phantom Modal */
.phantom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000; /* Increased to ensure it's above sidemenu */
    display: flex;
    align-items: center;
    justify-content: center;
}

.phantom-modal .modal-backdrop {
    position: fixed; /* Changed from absolute to fixed */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 100000; /* Ensure backdrop is also above sidemenu */
}

.phantom-modal .modal-content {
    position: relative;
    background: var(--bg-medium);
    border: 1px solid var(--phantom-purple);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(171, 159, 242, 0.3);
    animation: modalSlideIn 0.3s ease;
    z-index: 100001; /* Ensure content is also above everything */
}

.phantom-modal .modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(171, 159, 242, 0.1) 0%, transparent 100%);
}

.phantom-modal .modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.phantom-modal .modal-header h3 i {
    color: var(--phantom-purple);
}

.phantom-modal .modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.phantom-modal .modal-close:hover {
    color: var(--phantom-purple);
    background: rgba(171, 159, 242, 0.1);
}

.phantom-modal .modal-body {
    padding: 1.5rem;
}

.phantom-modal .modal-body p {
    color: var(--text-secondary);
    margin: 1rem 0;
    line-height: 1.6;
}

.phantom-modal .modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.phantom-modal .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    flex: 1;
    justify-content: center;
}

.phantom-modal .btn-primary {
    background: var(--phantom-gradient);
    color: white;
}

.phantom-modal .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(171, 159, 242, 0.4);
}

.phantom-modal .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.phantom-modal .btn-secondary:hover {
    border-color: var(--phantom-purple);
    color: var(--phantom-purple);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-medium);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 100001; /* Increased to be above modal */
}

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

.toast-success {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1) 0%, var(--bg-medium) 100%);
}

.toast-success i {
    color: var(--primary);
}

.toast-error {
    border-color: var(--error);
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.1) 0%, var(--bg-medium) 100%);
}

.toast-error i {
    color: var(--error);
}

.toast-info {
    border-color: var(--phantom-purple);
    background: linear-gradient(135deg, rgba(171, 159, 242, 0.1) 0%, var(--bg-medium) 100%);
}

.toast-info i {
    color: var(--phantom-purple);
}

/* Wallet Integration Badge */
.wallet-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(171, 159, 242, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--phantom-purple);
    color: var(--phantom-purple);
    font-size: 0.875rem;
    font-weight: 600;
}

.wallet-badge i {
    font-size: 1rem;
}

/* Animation Keyframes */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wallet-connected-info {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .wallet-address {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .wallet-address .address {
        text-align: center;
        word-break: break-all;
    }
    
    .scan-history-item {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .scan-results {
        justify-content: space-between;
    }
    
    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
    }
}