@import "./tokens.css";

/* ==========================================================================
   JASPER HORIZON Web Portal Component Styles (style.css ≤ 320 lines)
   ========================================================================== */

/* Layout & Nav Header */
.app-container { max-width: 1440px; margin: 0 auto; padding: 24px; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; margin-bottom: 24px; position: sticky; top: 16px; z-index: 100; }
.brand-group { display: flex; align-items: center; gap: 16px; }
.brand-logo { width: 44px; height: 44px; background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan)); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 22px; box-shadow: var(--shadow-glow); }
.brand-title { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; background: linear-gradient(to right, #fff, #94a3b8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.brand-subtitle { font-size: 12px; color: var(--accent-teal); font-weight: 600; letter-spacing: 0.5px; }
.status-pill { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent-emerald); background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.25); padding: 6px 14px; border-radius: 9999px; }
.pulse-dot { width: 8px; height: 8px; background-color: var(--accent-emerald); border-radius: 50%; box-shadow: 0 0 10px var(--accent-emerald); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.4); opacity: 0.5; } }

/* Tab Nav Bar */
.nav-tabs-wrapper { display: flex; gap: 8px; overflow-x: auto; padding: 8px; margin-bottom: 28px; border-radius: var(--radius-xl); scrollbar-width: none; }
.nav-tab { background: transparent; border: 1px solid transparent; color: var(--text-secondary); padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: var(--radius-lg); cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.nav-tab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.nav-tab.active { color: #fff; background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), rgba(6, 182, 212, 0.2)); border-color: var(--accent-teal); box-shadow: var(--shadow-glow); }
.tab-pane { display: none; animation: fadeIn 0.3s ease-in-out; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Hero Banner & KPI Grid */
.hero-banner { padding: 36px 32px; margin-bottom: 28px; position: relative; overflow: hidden; }
.hero-title { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.hero-desc { color: var(--text-secondary); max-width: 860px; font-size: 15px; margin-bottom: 24px; line-height: 1.7; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.kpi-card { padding: 20px; border-radius: var(--radius-md); position: relative; }
.kpi-label { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; }
.kpi-val { font-size: 26px; font-weight: 800; font-family: var(--font-mono); }
.kpi-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Section Header */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.section-title { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }

/* Filter & Controls */
.filter-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.search-input, .select-input { background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-glass); color: #fff; padding: 10px 16px; border-radius: var(--radius-md); font-size: 14px; outline: none; transition: border-color var(--transition-fast); }
.search-input:focus, .select-input:focus { border-color: var(--accent-teal); }
.search-input { min-width: 260px; flex-grow: 1; }

/* Table System */
.table-responsive { width: 100%; overflow-x: auto; border-radius: var(--radius-lg); margin-bottom: 24px; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
.data-table th { background: rgba(15, 23, 42, 0.95); color: var(--text-muted); font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--border-glass); text-transform: uppercase; font-size: 12px; letter-spacing: 0.5px; white-space: nowrap; }
.data-table td { padding: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--text-primary); vertical-align: middle; }
.data-table tbody tr { transition: background-color var(--transition-fast); }
.data-table tbody tr:hover { background-color: var(--bg-card-hover); }

/* Badges & Tags */
.badge-gold { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.3); padding: 4px 10px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.unit-price-pill { background: rgba(59, 130, 246, 0.15); color: #60A5FA; border: 1px solid rgba(59, 130, 246, 0.3); padding: 4px 8px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-weight: 700; font-size: 13px; display: inline-block; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.tag-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.tag-rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.tag-indigo { background: rgba(99, 102, 241, 0.15); color: var(--accent-indigo); }
.text-emerald { color: var(--accent-emerald); font-family: var(--font-mono); }
.text-rose { color: var(--accent-rose); font-family: var(--font-mono); }
.text-indigo { color: var(--accent-indigo); font-family: var(--font-mono); }
.sub-tip { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

/* Interactive Calculator Layout */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 900px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-form { padding: 28px; }
.calc-result-panel { padding: 28px; display: flex; flex-direction: column; justify-content: space-between; }
.form-group { margin-bottom: 22px; }
.form-label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.form-label-val { color: var(--accent-teal); font-family: var(--font-mono); font-weight: 700; }
.range-slider { width: 100%; height: 6px; border-radius: 3px; background: #1E293B; outline: none; -webkit-appearance: none; accent-color: var(--accent-teal); }
.res-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }
.res-card { background: rgba(15, 23, 42, 0.8); border: 1px solid var(--border-glass); padding: 16px; border-radius: var(--radius-md); }
.res-card.highlight-emerald { border-color: rgba(16, 185, 129, 0.4); background: rgba(16, 185, 129, 0.05); }
.res-card.highlight-rose { border-color: rgba(244, 63, 94, 0.4); background: rgba(244, 63, 94, 0.05); }
.res-card.highlight-gold { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.05); }
.res-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.res-val { font-size: 22px; font-weight: 800; font-family: var(--font-mono); }
.res-sub { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* Product Units Grid */
.units-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.unit-card { padding: 24px; position: relative; display: flex; flex-direction: column; justify-content: space-between; border-radius: var(--radius-lg); }
.unit-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.unit-title { font-size: 18px; font-weight: 700; }
.unit-price-range { font-size: 22px; font-weight: 800; color: var(--accent-rose); font-family: var(--font-mono); margin-bottom: 12px; }
.unit-params { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; margin-bottom: 16px; background: rgba(15, 23, 42, 0.6); padding: 12px; border-radius: var(--radius-md); }

/* Note Media Viewer */
.media-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.media-item { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-glass); background: #000; position: relative; }
.media-item img { width: 100%; height: 200px; object-fit: cover; transition: transform var(--transition-normal); display: block; }
.media-item:hover img { transform: scale(1.05); }
.media-caption { padding: 12px; font-size: 13px; font-weight: 600; background: rgba(15, 23, 42, 0.9); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; cursor: pointer; transition: all var(--transition-fast); text-decoration: none; border: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent-teal), var(--accent-cyan)); color: #fff; box-shadow: var(--shadow-glow); }
.btn-primary:hover { opacity: 0.95; transform: translateY(-1px); }
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); border: 1px solid var(--border-glass); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); }
.btn-calc { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }

/* Responsive adjustments */
@media (max-width: 768px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .res-card-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 22px; }
}
