/* tanso.market - Carbon Credit Marketplace */
/* Palette: #FFFFFF Market White, #F8FAFC Light Panel, #0052CC Trust Blue, #0747A6 Deep Trust,
   #172B4D Market Navy, #6B778C Ledger Gray, #00875A Verified Green, #DE350B Decline Red, #E4E7EB Border */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #FFFFFF;
    color: #172B4D;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
}

/* Typography */
.section-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #172B4D;
    margin-bottom: 1rem;
}

.mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* ========== NAVBAR ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #FFFFFF;
    border-bottom: 1px solid #E4E7EB;
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo {
    flex-shrink: 0;
}

.nav-title {
    font-weight: 700;
    font-size: 18px;
    color: #172B4D;
    letter-spacing: -0.3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #6B778C;
    text-decoration: none;
    transition: color 0.15s;
}

.nav-link:hover {
    color: #0052CC;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lock-icon {
    flex-shrink: 0;
}

.nav-account {
    color: #0052CC;
    font-weight: 600;
}

/* ========== HERO ========== */
.hero {
    background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
    padding: 4rem 2rem 3rem;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-heading {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: #172B4D;
    margin-bottom: 0.75rem;
}

.hero-sub {
    font-size: 15px;
    color: #6B778C;
    max-width: 560px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.search-wrapper {
    position: relative;
    max-width: 560px;
    margin: 0 auto 2rem;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-input {
    width: 100%;
    border: 1px solid #E4E7EB;
    border-radius: 8px;
    padding: 0.85rem 1rem 0.85rem 42px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    color: #172B4D;
    outline: none;
    background: #FFFFFF;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
    border-color: #0052CC;
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.search-input::placeholder {
    color: #6B778C;
}

.market-summary {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.summary-card {
    background: #FFFFFF;
    border: 1px solid #E4E7EB;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: center;
    min-width: 140px;
}

.summary-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B778C;
    margin-bottom: 4px;
}

.summary-value {
    display: block;
    font-size: 20px;
    font-weight: 500;
    color: #172B4D;
}

.summary-value .unit {
    font-size: 12px;
    color: #6B778C;
}

.trend-up {
    color: #00875A;
}

.trend-down {
    color: #DE350B;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.cta-primary {
    display: inline-block;
    background: #0052CC;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    padding: 0.7rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.cta-primary:hover {
    background: #0747A6;
}

.cta-secondary {
    display: inline-block;
    background: transparent;
    border: 1.5px solid #0052CC;
    color: #0052CC;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    padding: 0.7rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.cta-secondary:hover {
    background: #0052CC;
    color: #FFFFFF;
}

/* Arrow icons */
.arrow-up, .arrow-down {
    vertical-align: middle;
    margin-left: 2px;
}

/* ========== LISTINGS SECTION ========== */
.listings-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.listings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
}

/* Filter Sidebar */
.filter-sidebar {
    background: #F8FAFC;
    border: 1px solid #E4E7EB;
    border-radius: 8px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 72px;
}

.filter-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: #172B4D;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #E4E7EB;
}

.filter-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E4E7EB;
}

.filter-group:last-of-type {
    border-bottom: none;
}

.filter-group-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #6B778C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #172B4D;
    cursor: pointer;
    padding: 4px 0;
    position: relative;
}

.filter-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #E4E7EB;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.15s, border-color 0.15s;
    position: relative;
}

.filter-checkbox input[type="checkbox"]:checked {
    background: #0052CC;
    border-color: #0052CC;
}

.filter-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-reset-btn {
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid #E4E7EB;
    border-radius: 6px;
    color: #6B778C;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-top: 0.5rem;
}

.filter-reset-btn:hover {
    color: #DE350B;
    border-color: #DE350B;
}

/* Listings Main */
.listings-main {
    min-width: 0;
}

.listings-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.listings-count {
    font-size: 13px;
    color: #6B778C;
}

.table-wrapper {
    border: 1px solid #E4E7EB;
    border-radius: 8px;
    overflow: hidden;
}

.listing-table {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.listing-table thead {
    background: #F8FAFC;
    position: sticky;
    top: 56px;
    z-index: 10;
}

.listing-table th {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 11px;
    color: #6B778C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid #172B4D;
    white-space: nowrap;
    user-select: none;
}

.listing-table th.sortable {
    cursor: pointer;
    transition: color 0.15s;
}

.listing-table th.sortable:hover {
    color: #0052CC;
}

.sort-arrow {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: #6B778C;
}

.sort-arrow::after {
    content: '\2195';
}

th.sort-asc .sort-arrow::after {
    content: '\2191';
    color: #0052CC;
}

th.sort-desc .sort-arrow::after {
    content: '\2193';
    color: #0052CC;
}

.listing-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #E4E7EB;
    font-size: 14px;
    color: #172B4D;
    transition: background-color 0.15s;
}

.listing-table tbody tr:nth-child(even) {
    background: #F8FAFC;
}

.listing-table tbody tr:hover {
    background: rgba(0, 82, 204, 0.04);
}

.listing-table tbody tr.hidden-row {
    display: none;
}

.project-name {
    font-weight: 600;
    color: #172B4D;
}

.price {
    color: #0052CC;
    font-weight: 500;
    white-space: nowrap;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border: 2px solid #00875A;
    border-radius: 12px;
    color: #00875A;
    white-space: nowrap;
}

.shield-icon {
    flex-shrink: 0;
}

.action-btn {
    background: transparent;
    border: 1px solid #0052CC;
    color: #0052CC;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.action-btn:hover {
    background: #0052CC;
    color: #FFFFFF;
}

/* ========== ANALYTICS SECTION ========== */
.analytics-section {
    background: #F8FAFC;
    padding: 3rem 2rem;
}

.analytics-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: auto auto;
    gap: 1.5rem;
}

.chart-panel {
    background: #FFFFFF;
    border: 1px solid #E4E7EB;
    border-radius: 8px;
    padding: 1.5rem;
    grid-row: 1 / 2;
    grid-column: 1 / 2;
}

.depth-panel {
    background: #FFFFFF;
    border: 1px solid #E4E7EB;
    border-radius: 8px;
    padding: 1.5rem;
    grid-row: 1 / 2;
    grid-column: 2 / 3;
}

.volume-panel {
    background: #FFFFFF;
    border: 1px solid #E4E7EB;
    border-radius: 8px;
    padding: 1.5rem;
    grid-row: 2 / 3;
    grid-column: 1 / 3;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.chart-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #172B4D;
}

.chart-period-tabs {
    display: flex;
    gap: 4px;
}

.period-tab {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid #E4E7EB;
    border-radius: 4px;
    color: #6B778C;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.period-tab:hover {
    border-color: #0052CC;
    color: #0052CC;
}

.period-tab.active {
    background: #0052CC;
    border-color: #0052CC;
    color: #FFFFFF;
}

.chart-value-display {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 1rem;
}

.chart-current-price {
    font-size: 28px;
    font-weight: 500;
    color: #172B4D;
}

.chart-change {
    font-size: 14px;
    font-weight: 500;
}

.price-chart {
    width: 100%;
    height: 180px;
    display: block;
}

.chart-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-dot {
    opacity: 0.6;
    transition: opacity 0.2s, r 0.2s;
}

.chart-dot:hover {
    opacity: 1;
    r: 5;
}

.chart-dot-active {
    opacity: 1;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { r: 5; opacity: 1; }
    50% { r: 7; opacity: 0.7; }
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0 0;
}

.chart-labels span {
    font-size: 11px;
    color: #6B778C;
}

/* Order Book / Market Depth */
.order-book {
    margin-top: 1rem;
}

.order-book-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.ob-label {
    font-size: 10px;
    font-weight: 600;
    color: #6B778C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ob-label:first-child {
    text-align: right;
}

.ob-label:last-child {
    text-align: left;
}

.order-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto 1fr;
    align-items: center;
    gap: 0;
    padding: 4px 0;
    position: relative;
    height: 28px;
}

.bid-bar {
    height: 20px;
    background: rgba(0, 135, 90, 0.12);
    border-radius: 2px;
    justify-self: end;
    transition: width 0.3s;
}

.ask-bar {
    height: 20px;
    background: rgba(222, 53, 11, 0.12);
    border-radius: 2px;
    justify-self: start;
    transition: width 0.3s;
}

.ob-bid {
    font-size: 12px;
    color: #00875A;
    text-align: right;
    padding: 0 8px;
    min-width: 56px;
}

.ob-price {
    font-size: 12px;
    color: #172B4D;
    font-weight: 500;
    text-align: center;
    min-width: 60px;
}

.ob-ask {
    font-size: 12px;
    color: #DE350B;
    text-align: left;
    padding: 0 8px;
    min-width: 56px;
}

.spread-row {
    border-top: 1px dashed #E4E7EB;
    border-bottom: 1px dashed #E4E7EB;
    margin: 4px 0;
    padding: 6px 0;
}

.ob-spread {
    font-size: 11px;
    color: #6B778C;
    text-align: center;
    grid-column: 1 / -1;
}

/* Volume Panel */
.volume-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 120px;
    padding: 1rem 0;
    gap: 8px;
}

.vol-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.vol-bar {
    width: 100%;
    max-width: 60px;
    background: rgba(0, 82, 204, 0.15);
    border-radius: 4px 4px 0 0;
    transition: background-color 0.2s, height 0.3s;
}

.vol-col:hover .vol-bar,
.vol-col.active-day .vol-bar {
    background: #0052CC;
}

.vol-label {
    font-size: 11px;
    color: #6B778C;
    margin-top: 6px;
}

.volume-stats {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #E4E7EB;
    margin-top: 1rem;
}

.vol-stat-label {
    font-size: 11px;
    color: #6B778C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 2px;
}

.vol-stat-value {
    font-size: 16px;
    color: #172B4D;
}

/* ========== TRUST SECTION ========== */
.trust-section {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.trust-inner {
    text-align: center;
}

.trust-description {
    font-size: 15px;
    color: #6B778C;
    max-width: 640px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.trust-partners {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.partner-card {
    background: #FFFFFF;
    border: 1px solid #E4E7EB;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.partner-card:hover {
    border-color: #00875A;
    box-shadow: 0 2px 12px rgba(0, 135, 90, 0.08);
}

.partner-icon {
    margin-bottom: 1rem;
}

.partner-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #172B4D;
    margin-bottom: 0.5rem;
}

.partner-desc {
    font-size: 13px;
    color: #6B778C;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.partner-count {
    font-size: 13px;
    color: #0052CC;
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6B778C;
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(23, 43, 77, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #FFFFFF;
    border-radius: 12px;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.25s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6B778C;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.modal-close:hover {
    background: #F8FAFC;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.modal-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #172B4D;
}

.modal-badge {
    font-size: 12px;
}

.modal-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.modal-detail {
    background: #F8FAFC;
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

.detail-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6B778C;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 16px;
    color: #172B4D;
    font-weight: 500;
}

/* Provenance Chain */
.modal-provenance {
    margin-bottom: 1.5rem;
}

.provenance-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #172B4D;
    margin-bottom: 1rem;
}

.provenance-chain {
    position: relative;
    padding-left: 24px;
}

.provenance-chain::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #E4E7EB;
}

.provenance-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 1rem;
    position: relative;
}

.provenance-step:last-child {
    margin-bottom: 0;
}

.provenance-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2px solid #00875A;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    margin-left: -24px;
}

.provenance-dot.active {
    background: #00875A;
}

.provenance-dot.active::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #FFFFFF;
}

.provenance-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #172B4D;
}

.provenance-date {
    display: block;
    font-size: 12px;
    color: #6B778C;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-buy-btn {
    flex: 1;
}

.modal-docs-btn {
    flex: 1;
}

/* ========== FOOTER ========== */
.footer {
    border-top: 1px solid #E4E7EB;
    padding: 3rem 2rem 2rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #E4E7EB;
}

.footer-col-title {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: #172B4D;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.footer-link {
    display: block;
    font-size: 14px;
    color: #6B778C;
    text-decoration: none;
    padding: 3px 0;
    transition: color 0.15s;
}

.footer-link:hover {
    color: #0052CC;
}

.footer-bottom {
    text-align: center;
}

.footer-trust-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6B778C;
}

.footer-copy {
    font-size: 12px;
    color: #6B778C;
}

/* ========== FADE-IN ANIMATION ========== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .listings-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
    }

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

    .depth-panel {
        grid-column: 1;
        grid-row: auto;
    }

    .volume-panel {
        grid-column: 1;
    }

    .trust-partners {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 600px) {
    .hero-heading {
        font-size: 24px;
    }

    .market-summary {
        flex-direction: column;
        align-items: center;
    }

    .summary-card {
        width: 100%;
        max-width: 280px;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

    .trust-partners {
        grid-template-columns: 1fr;
    }

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

    .listing-table th,
    .listing-table td {
        padding: 8px 8px;
        font-size: 12px;
    }

    .modal-details-grid {
        grid-template-columns: 1fr;
    }
}
