:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --bg-light: #f8f9fa;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
    --card-bg: #ffffff;
    --text-color: #212529;
}

[data-bs-theme="dark"] {
    --primary-color: #3d8bfd;
    --secondary-color: #6c757d;
    --success-color: #2da44e;
    --bg-light: #212529;
    --border-color: #495057;
    --text-muted: #adb5bd;
    --card-bg: #2b3035;
    --text-color: #f8f9fa;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
}

.typeahead-input {
    text-transform: uppercase;
}

.typeahead-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15);
}

header {
    background-color: var(--card-bg);
    border-bottom: 2px solid var(--primary-color);
}

header h1 {
    color: var(--text-color);
    font-weight: 600;
}

.card {
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background-color: var(--card-bg);
}

.card-header {
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
}

.card-header.bg-light {
    background-color: var(--bg-light) !important;
}

.card-header.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Registry Card with Blur Effects */
.registry-card {
    font-size: 0.9rem;
}

.registry-field {
    margin-bottom: 0.5rem;
}

.registry-field-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.registry-field-value {
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-light);
    border-radius: 0.25rem;
}

.registry-field-value.blurred {
    filter: blur(4px);
    user-select: none;
    transition: filter 0.3s ease;
}

.registry-field-value.blurred:hover {
    filter: blur(0);
}

.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    color: var(--text-color);
    border: 1px solid transparent;
    border-bottom: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
    border-color: var(--border-color) var(--border-color) transparent;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background-color: white;
    border-color: var(--border-color) var(--border-color) white;
    border-bottom: 2px solid white;
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-control:disabled,
.form-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Timer Display */
.timer-display {
    font-family: 'Courier New', monospace;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.data-entry-panel {
    background: radial-gradient(circle at top left, rgba(13, 110, 253, 0.08), transparent 45%) var(--card-bg);
    border: 1px solid rgba(13, 110, 253, 0.2);
}

.entry-toolbar .faux-input {
    font-weight: 600;
    letter-spacing: 0.05em;
}

.entry-toolbar small {
    display: block;
    margin-top: 0.35rem;
}

.entry-actions .btn {
    min-width: 90px;
}

.method-switch {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.method-chip {
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.35rem 1.25rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-color);
    transition: all 0.2s ease;
}

.method-chip:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.method-chip.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.method-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.faux-ledger {
    border: 1px dashed rgba(108, 117, 125, 0.6);
    border-radius: 0.75rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(108, 117, 125, 0.08), transparent 60%);
    min-height: 220px;
}

.faux-ledger .registry-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px dashed rgba(108, 117, 125, 0.3);
}

.faux-ledger .registry-field:last-child {
    border-bottom: none;
}

.faux-ledger .registry-field-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.method-panels {
    margin-top: 2rem;
    position: relative;
}

.method-panel {
    display: none;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] .method-panel {
    background: rgba(33, 37, 41, 0.92);
}

.method-panel.active {
    display: block;
}

.method-panel-head h5 {
    font-weight: 700;
}

.method-fieldset[disabled] {
    opacity: 0.6;
    pointer-events: none;
}

.helper-line {
    font-size: 0.85rem;
}

.faux-table table {
    background: transparent;
}

.intel-panel {
    border: 1px solid rgba(108, 117, 125, 0.2);
    background: linear-gradient(175deg, rgba(108, 117, 125, 0.06), transparent 55%);
}

.target-address,
.method-order-callout,
.entry-format-callout {
    border: 1px solid rgba(108, 117, 125, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    min-height: 80px;
}

.entry-format-callout {
    background: rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
}

.pending-input {
    opacity: 0.65;
}

.method-order-callout ol {
    margin: 0;
    padding-left: 1.1rem;
}

.placeholder-block {
    background: rgba(108, 117, 125, 0.1);
    border-radius: 0.5rem;
    padding: 1rem;
}

.metric-table th,
.metric-table td {
    padding: 0.3rem 0.4rem;
    font-size: 0.85rem;
}

.session-progress .progress {
    background: rgba(108, 117, 125, 0.2);
}

.panel-timer .timer-display {
    margin-top: 0.35rem;
    font-size: 1.75rem;
}

.method-panel .alert {
    border-radius: 0.75rem;
}

.faux-table .table {
    margin-bottom: 0;
}

/* Tables */
.table {
    font-size: 0.9rem;
}

.table thead th {
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.table-bordered {
    border: 1px solid var(--border-color);
}

.table-bordered th,
.table-bordered td {
    border: 1px solid var(--border-color);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-sm {
    font-size: 0.85rem;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

[data-bs-theme="dark"] .alert-success {
    background-color: #0f5132;
    color: #d1e7dd;
}

.alert-info {
    background-color: #cff4fc;
    color: #055160;
}

[data-bs-theme="dark"] .alert-info {
    background-color: #055160;
    color: #cff4fc;
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-secondary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-outline-secondary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* List Group */
.list-group-item {
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.list-group-item:hover {
    background-color: var(--bg-light);
}

/* Comparison Table */
#comparisonResults .table {
    font-size: 0.95rem;
}

#comparisonResults .table th {
    background-color: #e9ecef;
    color: #2c3e50;
}

/* Footer */
footer {
    background-color: white;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .timer-display {
        font-size: 1.5rem;
        padding: 0.75rem;
    }

    .nav-tabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

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