/**
 * Transaction Simulator CSS
 * Styling for UTXO management, transaction building, and verification
 */

/* Main Container */
.visualizer-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

.tool-header h1 {
    color: #00ffff;
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.tool-header p {
    color: #00ff88;
    font-size: 1.1em;
}

/* Breadcrumb */
.breadcrumb {
    margin: 20px 0;
    padding: 10px;
    color: #00ff88;
    font-size: 0.9em;
    word-break: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    width: 100%;
}

.breadcrumb a {
    color: #00ffff;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #00ff88;
}

/* Instructions */
.instructions {
    background: rgba(0, 20, 40, 0.95);
    border-left: 3px solid #00ff88;
    border-radius: 4px;
    padding: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

.instructions h4 {
    color: #00ff88;
    margin-bottom: 10px;
}

.instructions ol {
    color: #ffffff;
    padding-left: 25px;
}

.instructions li {
    margin: 8px 0;
    line-height: 1.6;
}

/* UTXO List */
#utxo-list {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

#utxo-list h3 {
    color: #00ffff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.utxo-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    box-sizing: border-box;
}

.utxo-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.utxo-card:hover {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
}

.utxo-card.selected {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.utxo-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.utxo-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00ff88;
}

.utxo-amount {
    color: #00ff88;
    font-weight: bold;
    font-size: 1.1em;
    flex: 1;
}

.utxo-status {
    font-size: 0.8em;
    font-weight: bold;
}

.utxo-detail {
    font-size: 0.8em;
    color: #ffffff;
    opacity: 0.7;
    margin: 8px 0;
    line-height: 1.6;
}

.utxo-detail code {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    border-radius: 3px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
}

.utxo-address {
    font-size: 0.75em;
    color: #ffffff;
    opacity: 0.6;
    word-break: break-all;
}

.utxo-address code {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 4px;
    border-radius: 3px;
    color: #00ff88;
    font-family: 'Courier New', monospace;
}

/* Control Buttons */
.tx-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
    box-sizing: border-box;
}

.blockchain-btn {
    padding: 10px 20px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #00ffff;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85em;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.blockchain-btn:hover:not(:disabled) {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
}

.blockchain-btn:active:not(:disabled) {
    transform: translateY(0);
}

.blockchain-btn.primary {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
    color: #00ff88;
}

.blockchain-btn.primary:hover:not(:disabled) {
    background: rgba(0, 255, 136, 0.4);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
}

.blockchain-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Transaction Panel */
#transaction-panel {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #9d4edd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

.transaction-card h3 {
    color: #9d4edd;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.transaction-card h4 {
    color: #00ff88;
    margin: 15px 0 10px;
    text-transform: uppercase;
    font-size: 0.95em;
}

.section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section:last-child {
    border-bottom: none;
}

.inputs-list,
.outputs-list {
    margin: 10px 0;
}

.io-item {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #00ffff;
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.io-amount {
    color: #00ff88;
    font-weight: bold;
    min-width: 100px;
}

.io-address {
    color: #ffffff;
    flex: 1;
    min-width: 150px;
    word-break: break-all;
}

.io-detail {
    color: #00ffff;
    font-size: 0.85em;
    opacity: 0.8;
}

.remove-btn {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    padding: 5px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    background: rgba(255, 107, 107, 0.4);
}

.input-total {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    padding: 10px;
    border-radius: 4px;
    color: #ffffff;
    margin-top: 10px;
}

.add-output-section {
    box-sizing: border-box;
}

.add-output-section h5 {
    margin: 0 0 10px;
}

.quick-address-section,
.preset-recipients {
    box-sizing: border-box;
}

.quick-address-buttons,
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    box-sizing: border-box;
}

.addr-type-btn,
.preset-btn {
    padding: 8px 12px;
    background: rgba(0, 255, 136, 0.15);
    border: 1px solid #00ff88;
    border-radius: 4px;
    color: #00ff88;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-sizing: border-box;
    white-space: nowrap;
}

.addr-type-btn:hover,
.preset-btn:hover {
    background: rgba(0, 255, 136, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
    transform: translateY(-2px);
}

.addr-type-btn:active,
.preset-btn:active {
    transform: translateY(0);
}

.preset-btn {
    background: rgba(157, 78, 221, 0.15);
    border-color: #9d4edd;
    color: #9d4edd;
}

.preset-btn:hover {
    background: rgba(157, 78, 221, 0.3);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.4);
}

.add-output-form {
    display: grid;
    grid-template-columns: 1fr 200px auto;
    gap: 10px;
    box-sizing: border-box;
    margin-top: 15px;
}

.add-output-form input {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'Courier New', monospace;
    box-sizing: border-box;
}

.add-output-form input:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.fee-form {
    display: grid;
    grid-template-columns: 150px 120px auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.fee-form label {
    color: #00ffff;
    font-size: 0.9em;
}

.fee-form input {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffff;
    border-radius: 4px;
    color: #ffffff;
    box-sizing: border-box;
}

.fee-form input:focus {
    outline: none;
    border-color: #00ff88;
}

.fee-display {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    padding: 10px;
    border-radius: 4px;
    color: #00ff88;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 10px 0;
    box-sizing: border-box;
}

.summary-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #9d4edd;
    border-radius: 4px;
    padding: 12px;
    text-align: center;
    box-sizing: border-box;
}

.summary-item .label {
    display: block;
    color: #9d4edd;
    font-size: 0.85em;
    margin-bottom: 5px;
}

.summary-item .value {
    display: block;
    color: #00ff88;
    font-weight: bold;
    font-size: 1.1em;
    font-family: 'Courier New', monospace;
}

/* Verification Results */
#verification-results {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #9d4edd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

.verification-card {
    padding: 20px;
    border-radius: 6px;
    border: 2px solid;
    box-sizing: border-box;
}

.verification-card.valid {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.verification-card.invalid {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.verification-card h3 {
    margin-top: 0;
    color: inherit;
}

.verification-card.valid h3 {
    color: #00ff88;
}

.verification-card.invalid h3 {
    color: #ff6b6b;
}

.verification-detail {
    display: flex;
    gap: 15px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    box-sizing: border-box;
}

.verification-detail:last-of-type {
    border-bottom: none;
}

.verification-detail .label {
    color: #00ffff;
    font-weight: bold;
    min-width: 120px;
}

.verification-detail .value {
    color: #ffffff;
    flex: 1;
}

.verification-detail .value.hash-mono {
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
    word-break: break-all;
}

.verification-detail .value.valid {
    color: #00ff88;
}

.verification-detail .value.invalid {
    color: #ff6b6b;
}

.error-list {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid #ff6b6b;
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
}

.error-list h4 {
    color: #ff6b6b;
    margin: 0 0 8px;
}

.error-list ul {
    margin: 0;
    padding-left: 20px;
    color: #ffffff;
}

.error-list li {
    margin: 5px 0;
}

.verification-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

/* Transaction History */
#transaction-history {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
}

#transaction-history h3 {
    color: #00ffff;
    margin-bottom: 15px;
}

.history-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 6px;
    padding: 15px;
    transition: all 0.3s ease;
}

.history-card:hover {
    border-color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
}

.history-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.history-header .txid {
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    flex: 1;
}

.history-header .status {
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
}

.history-header .status.mempool {
    color: #ffd700;
}

.history-detail {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #ffffff;
    flex-wrap: wrap;
}

.history-detail span {
    display: flex;
    gap: 5px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #00ffff;
    opacity: 0.6;
    font-size: 1em;
}

/* Educational Content */
.how-it-works {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 20px;
    margin: 30px 0;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    width: 100%;
    overflow-x: auto;
}

.how-it-works h2 {
    color: #00ffff;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.how-it-works p {
    color: #ffffff;
    line-height: 1.8;
    margin: 10px 0;
    word-break: break-word;
}

.how-it-works ul,
.how-it-works ol {
    color: #ffffff;
    padding-left: 25px;
    margin: 10px 0;
}

.how-it-works li {
    margin: 8px 0;
}

/* Key Concepts */
.key-concepts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
    box-sizing: border-box;
}

.concept-card {
    background: rgba(0, 20, 40, 0.95);
    border: 1px solid #00ffff;
    border-radius: 8px;
    padding: 15px;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.concept-card h4 {
    color: #00ff88;
    margin-bottom: 8px;
}

.concept-card p {
    color: #ffffff;
    font-size: 0.9em;
    line-height: 1.6;
    word-break: break-word;
}

/* Responsive Design */
@media (max-width: 768px) {
    .visualizer-container {
        padding: 10px;
    }

    .tool-header h1 {
        font-size: 1.5em;
    }

    .utxo-items {
        grid-template-columns: 1fr;
    }

    .add-output-form {
        grid-template-columns: 1fr;
    }

    .quick-address-buttons,
    .preset-buttons {
        flex-direction: column;
        width: 100%;
    }

    .addr-type-btn,
    .preset-btn {
        width: 100%;
    }

    .fee-form {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .verification-buttons-grid {
        grid-template-columns: 1fr;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-detail {
        flex-direction: column;
        gap: 5px;
    }

    .key-concepts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.2em;
    }

    .io-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .io-address {
        width: 100%;
    }

    .verification-detail {
        flex-direction: column;
        align-items: flex-start;
    }

    .concept-card h4 {
        font-size: 0.95em;
    }

    .concept-card p {
        font-size: 0.85em;
    }
}