/* Knox Wallet Styles */
* { box-sizing: border-box; }
body { 
    margin: 0; background: #000; color: #fff; 
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
}

.container { max-width: 500px; margin: 0 auto; padding: 20px; }

/* Header */
.header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px;
}

.back-btn {
    color: #0f0; text-decoration: none; font-size: 14px;
}

/* Balance Card */
.balance-card {
    background: #111; border: 1px solid #333; border-radius: 20px;
    padding: 30px; text-align: center; margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,255,0,0.1);
}

.balance-label { color: #888; font-size: 14px; margin-bottom: 10px; }
.balance-amount { 
    font-size: 48px; font-weight: bold; color: #0f0;
    text-shadow: 0 0 20px rgba(0,255,0,0.3);
}
.copy-btn {
    background: none; border: 1px solid #0f0; color: #0f0;
    padding: 8px 20px; border-radius: 20px; margin-top: 10px;
    cursor: pointer; transition: 0.3s;
}
.copy-btn:hover { background: #0f0; color: #000; }

/* Action Buttons */
.action-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px;
    margin-bottom: 30px;
}
.action-btn {
    background: #111; border: 1px solid #333; border-radius: 15px;
    padding: 20px; text-align: center; cursor: pointer;
    transition: 0.3s; color: #fff; text-decoration: none;
}
.action-btn:hover { border-color: #0f0; transform: translateY(-2px); }
.action-icon { font-size: 24px; margin-bottom: 10px; color: #0f0; }

/* Modal */
.modal {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9); z-index: 1000;
    align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-content {
    background: #111; border-radius: 20px; padding: 30px;
    width: 90%; max-width: 400px; border: 1px solid #333;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-title { color: #0f0; margin-bottom: 20px; }
.modal-input {
    width: 100%; padding: 15px; background: #222;
    border: 1px solid #333; border-radius: 10px;
    color: #fff; margin-bottom: 15px;
}
.modal-actions {
    display: flex; gap: 10px; margin-top: 20px;
}
.modal-btn {
    flex: 1; padding: 12px; border: none; border-radius: 10px;
    cursor: pointer; font-weight: bold;
}
.modal-btn.primary { background: #0f0; color: #000; }
.modal-btn.secondary { background: #333; color: #fff; }

/* Biometric Overlay */
.bio-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #000; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
}
.bio-card {
    background: #111; border: 1px solid #333; border-radius: 20px;
    padding: 40px; text-align: center; max-width: 400px;
}
.bio-icon {
    width: 80px; height: 80px; margin: 0 auto 20px;
    filter: drop-shadow(0 0 10px #0f0);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.6; transform: scale(1); }
}
.bio-title { color: #0f0; font-size: 24px; margin-bottom: 10px; }
.bio-text { color: #888; margin-bottom: 20px; }
.bio-status { color: #ff8800; margin-top: 20px; }

/* Success Message */
.success-message {
    background: #0f0; color: #000; padding: 10px;
    border-radius: 10px; text-align: center; margin-top: 20px;
    font-weight: bold;
}

/* Scanner Toggle Button */
.scan-toggle {
    background: #333;
    color: #0f0;
    border: 1px solid #0f0;
    padding: 8px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 15px;
    width: 100%;
}
.scan-toggle:hover {
    background: #0f0;
    color: #000;
}

/* Error Message */
.error-message {
    background-color: rgba(255, 50, 50, 0.1);
    border: 1px solid #ff3232;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 20px;
    color: #ff6b6b;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}
.error-icon { font-size: 18px; }

/* ==================== QR SCANNER STYLES ==================== */

/* Camera Container */
#cameraContainer {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
    margin: 15px 0;
    border: 2px solid #333;
    transition: all 0.3s ease;
}

/* Scanner Region */
#reader {
    width: 100%;
    min-height: 280px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

#reader video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

#reader__scan_region {
    position: relative;
    min-height: 280px;
    background: #111;
    border: 2px solid #333;
    border-radius: 12px;
    overflow: hidden;
}

/* Hide dashboard elements */
#reader__dashboard_section {
    display: none !important;
}

/* Scan Line Animation */
#cameraContainer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #0f0;
    box-shadow: 0 0 10px #0f0;
    animation: scanMove 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
    opacity: 0.7;
}

@keyframes scanMove {
    0% { top: 10%; opacity: 0.3; }
    50% { top: 90%; opacity: 1; }
    100% { top: 10%; opacity: 0.3; }
}

/* Scan Result Message */
#scanResult {
    margin-top: 10px;
    padding: 8px;
    text-align: center;
    min-height: 36px;
    font-weight: bold;
}

#scanResult p {
    margin: 0;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==================== QR CODE DISPLAY ==================== */

/* Large QR code for receive modal */
#qrContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(45deg, #ffffff, #f0f0f0);
    border-radius: 20px;
    margin: 20px 0;
    min-height: 340px;
    border: 2px solid #0f0;
}

#qrContainer canvas {
    width: 300px !important;
    height: 300px !important;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 255, 0, 0.2);
}

/* Animation for slide down */
@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Simple wider address display */
.knox-address {
    background: #222;
    padding: 15px 20px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    margin-top: 20px;
    border: 1px solid #333;
    word-break: break-all;
    line-height: 1.5;
    letter-spacing: 0.5px;
}

/* Make the container wider on mobile */
@media screen and (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .balance-card {
        padding: 25px 15px;
    }
    
    .knox-address {
        font-size: 15px;
        padding: 12px 15px;
    }
}

/* For very small screens */
@media screen and (max-width: 360px) {
    .knox-address {
        font-size: 14px;
        padding: 10px 12px;
    }
}