/**
 * BNY Blockchain Viewer - Custom Styles
 * Brand Colors: Primary #04243C, Teal #00A3A1
 */

:root {
    --bny-primary: #04243C;
    --bny-primary-light: #0a3a5c;
    --bny-teal: #00A3A1;
    --bny-teal-light: #e6f7f7;
    --bny-bg: #F5F7FA;
    --bny-text: #2C3E50;
    --bny-border: #E1E8ED;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bny-bg);
    color: var(--bny-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* BNY Brand Colors */
.bg-bny-primary {
    background-color: var(--bny-primary) !important;
}

.bg-bny-primary-light {
    background-color: var(--bny-primary-light) !important;
}

.bg-bny-teal {
    background-color: var(--bny-teal) !important;
}

.bg-bny-teal-light {
    background-color: var(--bny-teal-light) !important;
}

.text-bny-primary {
    color: var(--bny-primary) !important;
}

.text-bny-teal {
    color: var(--bny-teal) !important;
}

.btn-bny-teal {
    background-color: var(--bny-teal);
    border-color: var(--bny-teal);
    color: white;
}

.btn-bny-teal:hover {
    background-color: #008f8d;
    border-color: #008f8d;
    color: white;
}

/* Light background variants */
.bg-success-light {
    background-color: #d4edda !important;
}

.bg-info-light {
    background-color: #d1ecf1 !important;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Statistics Cards */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(4, 36, 60, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(4, 36, 60, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--bny-primary);
}

.stat-label {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(4, 36, 60, 0.08);
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

/* Transaction List */
.transaction-list-container {
    max-height: 500px;
    overflow-y: auto;
}

.transaction-list-container::-webkit-scrollbar {
    width: 8px;
}

.transaction-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.transaction-list-container::-webkit-scrollbar-thumb {
    background: var(--bny-teal);
    border-radius: 4px;
}

.transaction-list-container::-webkit-scrollbar-thumb:hover {
    background: #008f8d;
}

.table thead th {
    border-bottom: 2px solid var(--bny-border);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bny-primary);
}

.table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s;
}

.table tbody tr:hover {
    background-color: var(--bny-teal-light);
}

.table tbody tr.selected {
    background-color: var(--bny-teal-light);
    border-left: 4px solid var(--bny-teal);
}

/* Filter Buttons */
.filter-btn {
    border-color: var(--bny-primary);
    color: var(--bny-primary);
}

.filter-btn:hover {
    background-color: var(--bny-primary-light);
    border-color: var(--bny-primary-light);
    color: white;
}

.filter-btn.active {
    background-color: var(--bny-primary);
    border-color: var(--bny-primary);
    color: white;
}

/* Transaction Details */
#transaction-details {
    min-height: 400px;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h5 {
    color: var(--bny-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bny-teal);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--bny-border);
}

.detail-label {
    font-weight: 600;
    color: var(--bny-primary);
    min-width: 180px;
}

.detail-value {
    color: var(--bny-text);
    word-break: break-all;
    text-align: right;
    flex: 1;
}

.detail-value code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--bny-primary);
}

/* Tabs */
.nav-tabs .nav-link {
    color: var(--bny-primary);
    border: none;
    border-bottom: 3px solid transparent;
}

.nav-tabs .nav-link:hover {
    border-color: var(--bny-teal-light);
    color: var(--bny-teal);
}

.nav-tabs .nav-link.active {
    color: var(--bny-teal);
    background-color: transparent;
    border-bottom: 3px solid var(--bny-teal);
    font-weight: 600;
}

/* Copy Button */
.copy-btn {
    cursor: pointer;
    color: var(--bny-teal);
    transition: color 0.15s;
}

.copy-btn:hover {
    color: #008f8d;
}

/* Encrypted Image */
.encrypted-image-container {
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.encrypted-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.decrypt-controls {
    margin-top: 1rem;
}

/* JSON Viewer */
.json-viewer {
    background-color: #f8f9fa;
    border: 1px solid var(--bny-border);
    border-radius: 8px;
    padding: 1rem;
    max-height: 500px;
    overflow-y: auto;
}

.json-viewer pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--bny-primary);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge.bg-bny-teal {
    background-color: var(--bny-teal) !important;
}

/* Loading States */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-info {
    background-color: var(--bny-teal-light);
    color: var(--bny-primary);
}

/* Dark Mode Toggle */
#darkModeToggle {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chart Containers */
canvas {
    max-height: 300px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .stat-value {
        font-size: 2rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-label {
        margin-bottom: 0.25rem;
    }

    .detail-value {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .transaction-list-container {
        max-height: 300px;
    }

    #transaction-details {
        min-height: 300px;
    }
}

/* Animation for stat values */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-value {
    animation: countUp 0.5s ease-out;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
}

.toast {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Utility Classes */
.text-truncate-2 {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.clickable {
    cursor: pointer;
}

.monospace {
    font-family: 'Courier New', monospace;
}

/* Vault Documents Styles */
.vault-documents-container {
    padding: 1rem 0;
}

.vault-document-card {
    margin-bottom: 1.5rem;
}

.vault-document-card .card {
    border: 2px solid var(--bny-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.vault-document-card .card:hover {
    border-color: var(--bny-teal);
    box-shadow: 0 4px 12px rgba(0, 163, 161, 0.1);
}

.vault-document-card .card-title {
    color: var(--bny-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.vault-doc-info {
    background-color: var(--bny-teal-light);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.vault-doc-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.vault-doc-info code {
    background-color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
    color: var(--bny-primary);
}

.vault-image-result {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.vault-image-result img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.decrypt-vault-btn {
    width: 100%;
    max-width: 200px;
}

.decrypt-vault-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
