/* Base styles */
body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
    background-color: #1a1a1a;
    color: #f0f0f0;
}

h1 {
    color: #ffffff;
    margin-bottom: 10px;
}

/* Buttons */	
button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 5px;
}

button:hover {
    background-color: #45a049;
}

button:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
}

.active {
    box-shadow: 0 0 0 3px #fbc02d;
}

.close-wallet-btn {
    background-color: #FFEB3B;
    color: #222;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin: 10px;
}

.close-wallet-btn:hover {
    background-color: #FFB300;
}

.wallet-loaded {
    background-color: #FFEB3B; /* Yellow, adjust to match .close-wallet-btn */
    color: #000;
    border: 1px solid #fbc02d;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
}

.wallet-loaded-active {
    background-color: #FFEB3B; /* Yellow, adjust to match .close-wallet-btn */
    color: #000;
    border: 1px solid #fbc02d;
    box-shadow: 0 0 0 3px #fbc02d;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
}

.wallet-loaded:hover {
    background-color: #FFB300;
}

.lastupdate-button {
    width: 300px;
    padding: 8px;
    margin: 5px 0;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
    cursor: pointer;
    text-align: left;
}

.lastupdate-button:hover {
    background-color: #444;
}

.light-mode .lastupdate-button {
    background-color: #fff;
    color: #333;
    border-color: #ccc;
}

.light-mode .lastupdate-button:hover {
    background-color: #f0f0f0;
}


.balance-button {
    width: 300px;
    padding: 8px;
    margin: 5px 0;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
    cursor: pointer;
    text-align: left;
}

.balance-button:hover {
    background-color: #444;
}

.light-mode .balance-button {
    background-color: #fff;
    color: #333;
    border-color: #ccc;
}

.light-mode .balance-button:hover {
    background-color: #f0f0f0;
}

/* Transaction table */
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

.transaction-table th,
.transaction-table td {
    border: 0px solid #444;
    padding: 3px;
}

.transaction-table th {
    background-color: #333;
    color: #f0f0f0;
}

.transaction-table td {
    background-color: #2c2c2c;
    color: #f0f0f0;
}

.transaction-table .tx-type-fee {
    color: #FFFF00;
}

.transaction-table .tx-type-send {
    color: #FF4444;
}

.transaction-table .tx-type-receive {
    color: #44FF44;
}

.light-mode .transaction-table th,
.light-mode .transaction-table td {
    border-color: #ddd;
}

.light-mode .transaction-table th {
    background-color: #e0e0e0;
    color: #333;
}

.light-mode .transaction-table td {
    background-color: #f9f9f9;
    color: #333;
}

.light-mode .transaction-table .tx-type-fee {
    color: #CC9900;
}

.light-mode .transaction-table .tx-type-send {
    color: #CC3333;
}

.light-mode .transaction-table .tx-type-receive {
    color: #33CC33;
}

/* Tally Hash Details Table */
.tally-hash-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
}

.tally-hash-table th,
.tally-hash-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #444;
}

.tally-hash-table th {
    background-color: #3a3a3a;
    color: #fff;
    text-align: center;
}

.tally-hash-table tr:last-child td {
    border-bottom: none;
}

.light-mode .tally-hash-table {
    background-color: #f9f9f9;
    border-color: #ddd;
}

.light-mode .tally-hash-table th {
    background-color: #e0e0e0;
    color: #000;
}

.light-mode .tally-hash-table td {
    border-bottom: 1px solid #ddd;
}

/* Transaction type and amount colors (reused from transaction-table) */
.tx-type-fee {
    color: #FFFF00;
}

.tx-type-send {
    color: #FF4444;
}

.tx-type-receive {
    color: #44FF44;
}

.tx-amount-fee {
    color: #FFFF00;
}

.tx-amount-send {
    color: #FF4444;
}

.tx-amount-receive {
    color: #44FF44;
}

.light-mode .tx-type-fee,
.light-mode .tx-amount-fee {
    color: #CC9900;
}

.light-mode .tx-type-send,
.light-mode .tx-amount-send {
    color: #CC3333;
}

.light-mode .tx-type-receive,
.light-mode .tx-amount-receive {
    color: #33CC33;
}


/* Containers */
.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px;
}

.close-wallet-container {
    text-align: right;
    margin-top: 10px;
}

.input-container {
    margin-top: 10px;
    padding: 15px;
    border: 2px solid #666;
    border-radius: 8px;
    background-color: #222;
    display: none;
    text-align: center;
}

/* Input fields */
.input-container input[type="text"],
.input-container input[type="number"],
.input-container input[type="password"] {
    width: 300px;
    padding: 8px;
    margin: 5px 0;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
}

.input-container select {
    width: 316px;
    padding: 8px;
    margin: 5px 0;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #444;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
}

.input-container label {
    display: inline-block;
    width: 120px;
    text-align: right;
    margin-right: 10px;
    font-size: 14px;
}

.input-container div {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px 0;
}

.navigator-container {
    margin-top: 20px;
    padding: 15px;
    border: 2px solid #666;
    border-radius: 8px;
    background-color: #222;
    display: none;
    text-align: left;
}

.navigator-container a {
    color: #44ffff;
    text-decoration: underline;
    cursor: pointer;
}

.navigator-container a:hover {
    color: #00cccc;
}

/* Checkbox container */
.checkbox-container {
    width: 300px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 5px 0;
}

/* File input styling */
.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: auto;
}

.file-input-wrapper input[type="file"] {
    width: 300px;
    background-color: #333;
    color: #f0f0f0;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}
.light-mode .file-input-wrapper input[type="file"] {
    background-color: #fff;
    color: #333;
    border: 1px solid #ccc;
}

.file-input-wrapper input[type="file"]::file-selector-button {
    display: inline-block;
    padding: 4px 8px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 8px;
}
.light-mode .file-input-wrapper input[type="file"]::file-selector-button {
    background-color: #0056b3;
}

.file-input-wrapper input[type="file"]:disabled {
    background-color: #e0e0e0;
    color: #666;
    cursor: not-allowed;
}

/* QR Code styling */
#qrcode {
    margin: 20px auto;
    display: block;
    background-color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    width: 200px;
    height: 200px;
    padding: 10px;
}
#transactionQR {
    margin: 20px auto;
    display: block;
    background-color: #fff;
    border: 1px solid #444;
    border-radius: 5px;
    width: 300px;
    height: 300px;
    padding: 10px;
}
.light-mode #qrcode, .light-mode #transactionQR {
    border-color: #ccc;
}

/* Result boxes */
.result-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    text-align: left;
    display: inline-block;
    max-width: 100%;
    line-height: 1.2;
}

.result-box .address-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wallet-label {
    font-weight: bold;
    margin-bottom: 10px;
}

.wallet-string {
    word-break: break-all;
    margin: 15px 0;
}

.wallet-copy {
    margin-top: 15px;
}

/* Broadcast result */
.broadcast-result {
    margin-top: 10px;
    padding: 10px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    text-align: center;
    display: none;
    max-width: 100%;
    line-height: 1.2;
}

.light-mode .broadcast-result {
    background-color: #f9f9f9;
    border-color: #ddd;
}

/* Warning box */
.warning-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #4a2c2c;
    border: 1px solid #ff4444;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    text-align: left;
    display: inline-block;
    max-width: 100%;
    line-height: 1.2;
}

.warning-box .private-key-box {
    display: block;
    margin: 10px auto;
    padding: 8px;
    font-size: 24px;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #ff4444;
    border-radius: 4px;
    background-color: #3a2222;
    color: #f0f0f0;
    text-align: center;
    box-sizing: border-box;
    width: fit-content;
}

/* Wallet box */
.wallet-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #2c4a2c;
    border: 1px solid #44ff44;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    text-align: left;
    display: inline-block;
    max-width: 100%;
    line-height: 1.2;
}


.wallet-box .address-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Copy button */
.copy-button {
    padding: 5px 10px;
    font-size: 14px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
}

.copy-button:hover {
    background-color: #1976D2;
}

/* Transaction line in cyan box */
.transaction-line {
    display: flex;
    justify_Content: space-between;
    align-items: flex-start;
    width: 100%;
}

.transaction-string {
    flex-grow: 1;
    word-break: break-all;
    text-align: left;
}

/* Error box */
.error-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #4a4a2c;
    border: 1px solid #ffff44;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    text-align: left;
    display: inline-block;
    max-width: 100%;
    line-height: 1.2;
    color: #f0f0f0;
}

.network-note {
    font-size: 0.9em;
    font-style: italic;
    text-align: center;
    margin-top: 10px;
}
.dark-mode .network-note { color: #aaa; }
.light-mode .network-note { color: #666; }

/* Provisioning box (cyan) */
.provisioning-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #2c4a4a;
    border: 1px solid #44ffff;
    border-radius: 5px;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace;
    text-align: left;
    display: inline-block;
    max-width: 100%;
    line-height: 1.2;
}

.provisioning-box textarea {
    width: 90%;
    height: 150px;
    padding: 8px;
    margin: 0 auto;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    border: 1px solid #44ffff;
    border-radius: 4px;
    background-color: #1a3a3a;
    color: #f0f0f0;
    resize: vertical;
    box-sizing: border-box;
    display: block;
    text-align: left;
}

.provisioning-box a {
    color: #44ffff;
    text-decoration: underline;
    cursor: pointer;
}
.provisioning-box a:hover {
    color: #00cccc;
}


/* Transaction box */
.transaction-box {
    display: flex;
	flex-direction: column;
    justify-content: column;
    align-items: right;
    margin: 1px 0;
    padding: 10px;
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

.transaction-box > div {
    flex: 1;
    text-align: right;
}

.transaction-box .detail-button {
    flex: 0 0 auto;
    margin-left: 10px;
}

.light-mode .transaction-box {
    background-color: #f9f9f9;
    border-color: #ddd;
}

/* Transaction type and amount colors */
.tx-type-fee {
    color: #FFFF00;
}

.tx-type-send {
    color: #FF4444;
}

.tx-type-receive {
    color: #44FF44;
}

.tx-amount-fee {
    color: #FFFF00;
}

.tx-amount-send {
    color: #FF4444;
}

.tx-amount-receive {
    color: #44FF44;
}

.light-mode .tx-type-fee,
.light-mode .tx-amount-fee {
    color: #CC9900;
}

.light-mode .tx-type-send,
.light-mode .tx-amount-send {
    color: #CC3333;
}

.light-mode .tx-type-receive,
.light-mode .tx-amount-receive {
    color: #33CC33;
}

/* Detail button */
.detail-button {
    background-color: #007bff;
    color: white;
    padding: 7px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.detail-button:hover {
    background-color: #0056b3;
}

.light-mode .detail-button {
    background-color: #0056b3;
}

.light-mode .detail-button:hover {
    background-color: #003d80;
}

/* Detail button (unchanged) */
.detail-button {
    background-color: #007bff;
    color: white;
    padding: 6px 12px;
    font-size: 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.detail-button:hover {
    background-color: #0056b3;
}

.light-mode .detail-button {
    background-color: #0056b3;
}

.light-mode .detail-button:hover {
    background-color: #003d80;
}


/* Light mode */
.light-mode {
    background-color: #ffffff;
    color: #333;
}

.light-mode h1,
.light-mode .key-label {
    color: #333;
}

.light-mode .result-box {
    background-color: #f9f9f9;
    border-color: #ddd;
}

.light-mode .warning-box {
    background-color: #fff4f4;
    border-color: #ff6666;
}

.light-mode .warning-box .private-key-box {
    background-color: #ffe6e6;
    border-color: #ff6666;
    color: #333;
}

.light-mode .wallet-box {
    background-color: #f4fff4;
    border-color: #66ff66;
}

.light-mode .error-box {
    background-color: #fffff4;
    border-color: #ffff66;
    color: #333;
}

.light-mode .input-container {
    border-color: #999;
    background-color: #f5f5f5;
}

.light-mode .input-container input[type="text"],
.light-mode .input-container input[type="number"],
.light-mode .input-container input[type="password"],
.light-mode .input-container select {
    background-color: #fff;
    color: #333;
    border-color: #ccc;
}

.light-mode .provisioning-box {
    background-color: #e6ffff;
    border-color: #00cccc;
}

.light-mode .provisioning-box a {
    color: #00cccc;
}

.light-mode .provisioning-box a:hover {
    color: #009999;
}

.light-mode .close-wallet-btn {
    background-color: #FFC107;
    color: #222;
}

.light-mode .close-wallet-btn:hover {
    background-color: #FFB300;
}

.light-mode .wallet-loaded {
    background-color: #FFC107;
    color: #222;
}

.light-mode .wallet-loaded:hover {
    background-color: #FFB300;
}

/* Footer */
footer {
    margin-top: 40px;
    font-size: 14px;
    color: #666;
}