body {-webkit-text-size-adjust: 100%; font-family: Arial, sans-serif; padding: 20px; max-width: 1200px; margin: auto; background-color: #f9f9f9; }
h1, h2, h3 { text-align: center; }
form { text-align: center; margin-bottom: 30px; }
input[type=text] { width: 80%; max-width: 500px; padding: 12px; font-size: 1.2em; }
button { padding: 12px 24px; font-size: 1.2em; margin-left: 10px; cursor: pointer; }

.balance-card { max-width: 650px; margin: 0 auto 30px auto; padding: 20px; background-color: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.balance-info { flex: 1 1 300px; min-width: 200px; }
.balance-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 1.1em; border-bottom: 1px solid #eee; }
.balance-row:last-child { border-bottom: none; }
.balance-row .label { font-weight: bold; }
.balance-row.received .value { color: green; font-weight: bold; }
.balance-row.sent .value { color: red; font-weight: bold; }
.qr-code { flex: 0 0 128px; margin-right: 20px; }
.qr-code-img { width: 128px; height:128px; display: inline-block; padding: 5px; border: 1px solid #f2f2f2; border-radius: 15px;box-shadow: 0 4px 10px rgba(0,0,0,0.2); background-color: #fff;}

.table-container { overflow-x: auto; margin-bottom: 20px; }
table { border-collapse: collapse; width: 100%; min-width: 1200px; font-size: 16px; }
th, td { border: 1px solid #ccc; padding: 8px; text-align: left; word-break: break-all; }
th { background-color: #eee; }
.spent { color: #aaa; }

.pagination { text-align: center; margin-top: 15px; display: flex; flex-wrap: wrap; justify-content: center; }
.pagination a, .pagination strong, .pagination .dots { display: inline-block; padding: 6px 12px; margin: 2px; border: 1px solid #ccc; text-decoration: none; color: #333; border-radius: 4px; min-width: 36px; text-align: center; }
.pagination strong { background-color: #fbc531; color: black; border-color: #fbc531; }
.pagination .dots { border: none; background: none; cursor: default; }
.pagination a:hover { background-color: #fff3c4; }

.navbar { display: flex; justify-content: center; gap: 20px; background: #fff; padding: 12px 20px; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); margin-bottom: 20px; }
.navbar a { text-decoration: none; font-weight: bold; color: #fbc531; padding: 6px 12px; border-radius: 6px; transition: background 0.2s, color 0.2s; }
.navbar a:hover { background-color: #fbc531; color: black; }

hr.footer-separator { border: none; border-top: 1px solid #ddd; margin: 40px 0 20px 0; }
footer { text-align: center; padding: 10px 0; color: #555; font-size: 0.95em; }

table th:nth-child(2),
table th:nth-child(3),
table th:nth-child(4),
table th:nth-child(5),
table th:nth-child(6),
table td:nth-child(2),
table td:nth-child(3),
table td:nth-child(4),
table td:nth-child(5),
table td:nth-child(6) {
    text-align: center;
}

.search-form {
    display: flex;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-form input[type=text] {
    flex: 1;
    padding: 12px;
    font-size: 1.1em;
    border: 1px solid #ccc;
    border-right: none;
    border-radius: 8px 0 0 8px;
    outline: none;
    margin: 0;
}

.search-form button {
    padding: 12px 24px;
    font-size: 1.1em;
    border: 1px solid #fbc531;
    border-left: none;
    background-color: #fbc531;
    color: black;
    cursor: pointer;
    border-radius: 0 8px 8px 0;
    transition: background 0.2s;
    margin: 0;
}

.search-form button:hover {
    background-color: #e1a500;
}

.spent-status {
    color: red;
    font-weight: bold;
}
.unspent-status {
    color: green;
    font-weight: bold;
}

/* Default links (navbar, body text, etc.) */
a {
    color: #666666;
    font-weight: bold;
    text-decoration: underline;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

a:hover {
    background-color: #ffcc00;
    color: #000;
    text-decoration: none;
}

/* Links inside tables */
/*

table a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    padding: 0;
    border-radius: 0;
}

table a:hover {
    text-decoration: underline;
    background: none;
    color: #0056b3;
}

*/

table a {
    color: #ffcc00;
    text-decoration: none;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

table a:hover {
    background-color: #ffcc00;
    color: #000;
    text-decoration: none;
}

.all-addresses-table td:nth-child(1),
.all-addresses-table td:nth-child(2) {
    text-align: left;
}
.all-addresses-table td:nth-child(3) {
    text-align: center;
}

.all-addresses-table a {
    color: #ffcc00;
    font-weight: bold;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}
.all-addresses-table a:hover {
    background-color: #ffcc00;
    color: #000;
    text-decoration: none;
}

.table-container table tr:hover,
.all-addresses-table tr:hover {
    background-color: #fff3c4;
}

@keyframes spinOnce {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loader overlay */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#loader.active {
    opacity: 1;
    pointer-events: all;
}

.spinner-logo {
    width: 128px;
    height: 128px;
    animation: spin 2s linear infinite;
}

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

@media screen and (max-width: 600px) {
    input[type=text] { width: 95%; }
    table, th, td { font-size: 10px; }
    .pagination a, .pagination strong, .pagination .dots { padding: 4px 8px; font-size: 0.9em; min-width: 28px; }

    /* Mobile: QR first, centered */
    .balance-card { 
        flex-direction: column; 
        align-items: center; 
        text-align: center; 
    }
    .qr-code { 
        margin: 0 0 15px 0; 
    }
    .balance-info { width: 100%; }
    .balance-row { 
        flex-direction: column; 
        align-items: center; 
    }
    .balance-row .value { margin-top: 4px; }
    table { 
        min-width: 800;
        width: 100%;
        font-size: 12px;
    }
    th, td {
        padding: 6px;
    } 
    .qr-code-img { width: 256px; height:256px; display: inline-block; padding: 5px; border: 1px solid #f2f2f2; border-radius: 15px;box-shadow: 0 4px 10px rgba(0,0,0,0.2); background-color: #fff;}
}

#myBtn {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: #999999;
  color: white;
  cursor: pointer;
  padding: 15px; 
  border-radius: 10px; 
  font-size: 18px; 
  opacity: 0.6;
  text-decoration: none;
}

#myBtn:hover {
  opacity: 0.8;
  text-decoration: none;
}