/* ── TariffForge: Professional Customs Intelligence Dashboard ── */

/* ── Header ──────────────────────────────────────────────────── */
.tf-header {
    background: var(--tf-navy);
    border-bottom: 3px solid var(--tf-teal);
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.tf-header .tf-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tf-header .tf-logo-icon {
    font-size: 1.3rem;
}

.tf-header .tf-logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tf-header .tf-logo-subtitle {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    border-left: 1px solid rgba(255,255,255,0.2);
    padding-left: 0.6rem;
    margin-left: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}

.tf-header .tf-nav-link {
    color: rgba(255,255,255,0.75);
    border-color: rgba(255,255,255,0.15);
    font-size: 0.82rem;
    transition: all 0.2s;
    border-radius: 6px;
}

.tf-header .tf-nav-link:hover,
.tf-header .tf-nav-link.active {
    color: #fff;
    background: rgba(20,184,166,0.2);
    border-color: var(--tf-teal);
}

/* ── Footer ──────────────────────────────────────────────────── */
.tf-footer {
    background: var(--tf-navy);
    color: rgba(255,255,255,0.65);
    border-top: 3px solid var(--tf-teal);
    padding: 1rem 0;
}

.tf-footer a {
    color: var(--tf-teal);
    text-decoration: none;
}

.tf-footer a:hover { color: #fff; }

.tf-footer-version {
    color: rgba(255,255,255,0.4);
}

/* ── Mode Toggle (Segmented Control) ─────────────────────────── */
.tf-mode-toggle {
    display: inline-flex;
    background: #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.tf-mode-btn {
    padding: 0.55rem 1.5rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #475569;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
}

.tf-mode-btn.active {
    background: var(--tf-navy);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15,23,42,0.25);
}

.tf-mode-btn:not(.active):hover {
    background: #cbd5e1;
}

/* ── Dashboard Cards ─────────────────────────────────────────── */
.tf-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: var(--tf-card-shadow);
    transition: box-shadow 0.3s;
}

.tf-card:hover {
    box-shadow: var(--tf-card-hover-shadow);
}

.tf-card-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tf-card-title .tf-badge {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.tf-card-title .tf-badge-teal { background: var(--tf-teal); }
.tf-card-title .tf-badge-indigo { background: var(--tf-indigo); }
.tf-card-title .tf-badge-amber { background: var(--tf-amber); }

/* ── Scenario Cards ──────────────────────────────────────────── */
.tf-scenario {
    border-top: 4px solid var(--tf-teal);
}

.tf-scenario.scenario-1 { border-top-color: var(--tf-teal); }
.tf-scenario.scenario-2 { border-top-color: var(--tf-indigo); }
.tf-scenario.scenario-3 { border-top-color: var(--tf-amber); }

.tf-scenario-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    font-size: 0.85rem;
}

.tf-scenario-label .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.scenario-1 .tf-scenario-label .dot { background: var(--tf-teal); }
.scenario-2 .tf-scenario-label .dot { background: var(--tf-indigo); }
.scenario-3 .tf-scenario-label .dot { background: var(--tf-amber); }

/* ── Form Styles ─────────────────────────────────────────────── */
.tf-card .form-control:focus,
.tf-card .form-select:focus {
    border-color: var(--tf-teal);
    box-shadow: 0 0 0 0.2rem rgba(20,184,166,0.15);
}

.tf-card .form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

/* ── Calculate Button ────────────────────────────────────────── */
.btn-tf-primary {
    background: var(--tf-teal);
    border-color: var(--tf-teal);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    transition: all 0.2s;
}

.btn-tf-primary:hover {
    background: var(--tf-teal-dark);
    border-color: var(--tf-teal-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(20,184,166,0.35);
}

.btn-tf-primary:active {
    transform: translateY(0);
}

.btn-tf-primary:disabled {
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

/* ── Result: Big Number ──────────────────────────────────────── */
.tf-result-highlight {
    background: linear-gradient(135deg, var(--tf-navy) 0%, var(--tf-navy-light) 100%);
    border-radius: 16px;
    color: #fff;
    padding: 2rem;
    text-align: center;
}

.tf-result-highlight .tf-big-rate {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    font-family: 'Inter', system-ui, sans-serif;
}

.tf-result-highlight .tf-big-rate.text-tf-teal { color: var(--tf-teal); }
.tf-result-highlight .tf-big-rate.text-tf-red { color: #f87171; }

.tf-result-highlight .tf-total-duty {
    font-size: 1.4rem;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin-top: 0.5rem;
}

/* ── Result Badges (Exclusion Codes) ─────────────────────────── */
.tf-exclusion-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--tf-teal-soft);
    color: var(--tf-teal-dark);
    border: 1px solid rgba(20,184,166,0.2);
    border-radius: 8px;
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tf-exclusion-badge:hover {
    background: rgba(20,184,166,0.15);
    border-color: var(--tf-teal);
}

/* ── Breakdown Table ─────────────────────────────────────────── */
.tf-table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.tf-table thead th {
    background: #f1f5f9;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.tf-table tbody td {
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.tf-table tbody tr:last-child td {
    border-bottom: none;
}

.tf-table .hts-mono {
    font-family: 'Consolas', 'SF Mono', 'Courier New', monospace;
    color: var(--tf-teal-dark);
    font-weight: 600;
    font-size: 0.84rem;
}

.tf-table tfoot td {
    background: var(--tf-navy);
    color: #fff;
    font-weight: 700;
    padding: 0.75rem 1rem;
}

/* ── Compare Mode: Summary Cards ─────────────────────────────── */
.tf-summary-card {
    text-align: center;
    padding: 1.25rem;
    border-radius: 12px;
    background: #fff;
    border: 2px solid #e2e8f0;
}

.tf-summary-card.sc-1 { border-color: var(--tf-teal); }
.tf-summary-card.sc-2 { border-color: var(--tf-indigo); }
.tf-summary-card.sc-3 { border-color: var(--tf-amber); }

.tf-summary-card .tf-summary-rate {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Inter', system-ui, sans-serif;
}

.tf-summary-card.sc-1 .tf-summary-rate { color: var(--tf-teal); }
.tf-summary-card.sc-2 .tf-summary-rate { color: var(--tf-indigo); }
.tf-summary-card.sc-3 .tf-summary-rate { color: var(--tf-amber); }

/* ── Compare Table ───────────────────────────────────────────── */
.tf-compare-table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.tf-compare-table thead th {
    background: var(--tf-navy);
    color: #fff;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding: 0.75rem 1rem;
    text-align: center;
}

.tf-compare-table thead th:first-child {
    text-align: left;
}

.tf-compare-table thead th.sc-1 { border-bottom: 3px solid var(--tf-teal); }
.tf-compare-table thead th.sc-2 { border-bottom: 3px solid var(--tf-indigo); }
.tf-compare-table thead th.sc-3 { border-bottom: 3px solid var(--tf-amber); }

.tf-compare-table tbody td {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.tf-compare-table tbody td:first-child {
    text-align: left;
}

.tf-compare-table tfoot td {
    background: #f8fafc;
    font-weight: 700;
    border-top: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    text-align: center;
}

.tf-compare-table tfoot td:first-child {
    text-align: left;
}

/* ── Add Scenario Button ─────────────────────────────────────── */
.btn-add-scenario {
    border: 2px dashed #cbd5e1;
    background: transparent;
    color: #64748b;
    border-radius: 12px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-add-scenario:hover:not(:disabled) {
    border-color: var(--tf-teal);
    color: var(--tf-teal);
    background: rgba(20,184,166,0.04);
}

.btn-add-scenario:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── Remove Scenario ─────────────────────────────────────────── */
.btn-remove-scenario {
    font-size: 0.75rem;
    color: #94a3b8;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.2rem 0.6rem;
    transition: all 0.2s;
}

.btn-remove-scenario:hover {
    color: #ef4444;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* ── Empty / Loading States ──────────────────────────────────── */
.tf-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}

.tf-empty-state .tf-empty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    opacity: 0.4;
}

/* ── Warning / Message ───────────────────────────────────────── */
.tf-alert {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 0.88rem;
}

/* ── Ad Sidebar ──────────────────────────────────────────────── */
.ad-sidebar {
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    background: #fafbfc !important;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 991.98px) {
    .tf-card { padding: 1.25rem; }
    .tf-result-highlight .tf-big-rate { font-size: 2.5rem; }
    .tf-mode-btn { padding: 0.45rem 1rem; font-size: 0.82rem; }
    .tf-compare-table { font-size: 0.8rem; }
}

@media (max-width: 767.98px) {
    .tf-mode-toggle { width: 100%; }
    .tf-mode-btn { flex: 1; text-align: center; padding: 0.5rem 0.5rem; font-size: 0.8rem; }
    .tf-summary-card .tf-summary-rate { font-size: 1.5rem; }
    .tf-compare-table { overflow-x: auto; display: block; }
}

/* ── News cards ──────────────────────────────────────────────── */
.ts-news-card {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ts-news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.ts-news-card .ts-news-tag {
    display: inline-block;
    background: var(--tf-teal-soft);
    color: var(--tf-teal-dark);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

/* ── Country Autocomplete ───────────────────────────────── */
.tf-autocomplete-dropdown {
    position: absolute;
    z-index: 1050;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
}
.tf-ac-item {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.92rem;
}
.tf-ac-item:hover {
    background: #f0fdfa;
    color: var(--tf-teal);
}
.tf-ac-other {
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-style: italic;
}
