/* ============================================
   BRAINWALLET SCANNER - STYLE.CSS
   ============================================ */

/* === BASE === */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f6f8;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1650px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* === HEADER === */
header { 
    text-align: center; 
    margin-bottom: 30px; 
}

h1 { 
    color: #1a1a1a; 
    margin-bottom: 5px; 
}

p { 
    color: #666; 
}

.status-box {
    background: #e3f2fd;
    color: #0d47a1;
    padding: 10px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 10px;
    font-weight: bold;
}

/* === TABELLA === */
.table-wrapper { 
    overflow-x: auto; 
}

table.dataTable thead th {
    background-color: #f8f9fa;
    color: #444;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

/* === ANTEPRIMA MESSAGGIO === */
.msg-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.clickable-preview {
    cursor: pointer;
    color: #2c3e50;
    border-bottom: 1px dashed #ccc;
    transition: background 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 350px;
    flex-grow: 1;
}

.clickable-preview:hover { 
    background-color: #fff3cd; 
    color: #000; 
}

/* === BOTTONE BITCOINTALK === */
a.forum-btn {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    background-color: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-family: 'Arial', sans-serif;
    color: #ff9900;
    font-weight: bold;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    height: 24px;
    margin-left: 8px;
    flex-shrink: 0;
}

a.forum-btn:hover {
    background-color: #fff8e1;
    border-color: #ff9900;
    color: #e68a00;
}

.icon-page {
    display: inline-block;
    width: 8px;
    height: 10px;
    background: linear-gradient(to bottom right, #fff 50%, #eee 50%);
    border: 1px solid #ff9900;
    margin-right: 5px;
}

/* === CHIAVI PRIVATE === */
code.copy-key {
    white-space: nowrap;
    font-size: 0.90em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 4px 8px;
    overflow: hidden;
    background: #fff0f6;
    border: 1px solid #fcc2d7;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    cursor: copy;
    color: #c2255c;
    transition: all 0.2s;
    font-weight: bold;
}

code.copy-key span {
    font-size: 1.1em;
    margin-left: 8px;
    cursor: pointer;
}

code.copy-key:hover { 
    background-color: #fcc2d7; 
    color: #a61e4d; 
}

code.copied { 
    background-color: #28a745 !important; 
    color: white !important; 
    border-color: #28a745 !important; 
}

/* === INDIRIZZI === */
.addr-container { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

a.addr-row {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-family: 'Consolas', monospace;
    font-size: 0.8em !important;
    color: #343a40;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

a.addr-row:hover { 
    background: #e7f5ff; 
    border-color: #74c0fc; 
}

/* === ETICHETTE INDIRIZZI === */
.tag {
    font-size: 0.60em !important;
    font-weight: 700;
    padding: 2px 4px !important;
    border-radius: 3px;
    margin-right: 6px;
    min-width: 50px !important;
    text-align: center;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.5px;
}

.tag.legacy { 
    background-color: #ffe8cc; 
    color: #fd7e14; 
    border: 1px solid #ffd8a8; 
}

.tag.nested { 
    background-color: #e3fafc; 
    color: #0c8599; 
    border: 1px solid #99e9f2; 
}

.tag.native { 
    background-color: #d3f9d8; 
    color: #2b8a3e; 
    border: 1px solid #b2f2bb; 
}

/* === STATUS BADGE === */
.status-badge {
    font-size: 0.65em;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.status-badge.virgin {
    background: #2d3748;
    color: #718096;
}

.status-badge.used {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.status-badge.funded {
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: white;
    animation: glow 1.5s ease-in-out infinite alternate;
}

.status-badge.checking {
    background: #4a5568;
    color: #a0aec0;
    animation: pulse 1s infinite;
}

.status-badge.error {
    background: #742a2a;
    color: #feb2b2;
}

/* === RIGHE EVIDENZIATE === */
tr.has-funds {
    background: linear-gradient(90deg, rgba(245, 175, 25, 0.15), rgba(241, 39, 17, 0.15)) !important;
}

tr.has-funds td {
    border-top: 1px solid rgba(245, 175, 25, 0.3);
    border-bottom: 1px solid rgba(241, 39, 17, 0.3);
}

tr.was-used {
    background: rgba(102, 126, 234, 0.08) !important;
}

/* === INDICATORE VERIFICA === */
.verify-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.verify-indicator.visible {
    opacity: 1;
}

.verify-indicator .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* === STATS BOX === */
.stats-box {
    display: inline-flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 0.85em;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-item.funded { 
    color: #e53e3e; 
    font-weight: bold; 
}

.stat-item.used { 
    color: #667eea; 
}

.stat-item.virgin { 
    color: #718096; 
}

/* === BOTTONE VERIFICA === */
.verify-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 12px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.verify-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.verify-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
}

/* === BOTTONE SCARICA CSV === */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #20c997;
    color: white;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    border: 1px solid #1aa179;
}

.download-btn:hover {
    background-color: #1aa179;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.download-btn:active {
    transform: translateY(0);
}

/* === MODAL === */
.modal { 
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); 
    backdrop-filter: blur(2px); 
}

.modal-content { 
    background-color: #fff; 
    margin: 5% auto; 
    padding: 0; 
    border: 1px solid #888; 
    width: 80%; 
    max-width: 800px; 
    border-radius: 12px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); 
}

.modal-header { 
    padding: 15px 20px; 
    background-color: #f8f9fa; 
    border-bottom: 1px solid #dee2e6; 
    border-radius: 12px 12px 0 0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.close { 
    color: #aaa; 
    font-size: 28px; 
    font-weight: bold; 
    cursor: pointer; 
}

.close:hover { 
    color: #000; 
}

.modal-body { 
    padding: 20px; 
    max-height: 60vh; 
    overflow-y: auto; 
    font-family: 'Inter', sans-serif; 
    line-height: 1.6; 
    color: #2c3e50; 
    white-space: pre-wrap; 
    word-break: break-word; 
}

/* === ANIMAZIONI === */
@keyframes glow {
    from { box-shadow: 0 0 5px rgba(245, 175, 25, 0.5); }
    to { box-shadow: 0 0 15px rgba(241, 39, 17, 0.8); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .download-btn,
    .verify-btn,
    .verify-indicator {
        display: block;
        margin: 10px auto;
    }
    
    .stats-box {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .clickable-preview {
        max-width: 150px;
    }
    
    code.copy-key {
        font-size: 0.75em;
    }
    
    a.addr-row {
        font-size: 0.7em !important;
    }
}
