/*
 * VarshaKrishi — css/pages/research-stations.css
 * Page-specific styles for the Research Stations page.
 * Strictly uses CSS tokens from tokens.css.
 */

/* ═══════════════════════════════════════════════════════════════
 * 1. HERO SECTION
 * ═══════════════════════════════════════════════════════════════ */

.rs-hero {
  position: relative;
  padding-top: calc(var(--nav-height) + var(--space-12));
  padding-bottom: var(--space-8);
  background:
    radial-gradient(ellipse 80% 55% at 50% -5%, rgba(45, 84, 56, 0.12) 0%, transparent 70%),
    var(--color-bg-base);
  border-bottom: 1px solid var(--color-border-default);
  text-align: center;
}

.rs-hero__inner {
  max-width: var(--grid-max);
  margin-inline: auto;
  padding-inline: var(--grid-padding);
}

.rs-hero__kicker {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-success);
  margin-bottom: var(--space-4);
}

.rs-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-3);
  max-width: 25ch;
  margin-inline: auto;
}

.rs-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 700px;
  margin-inline: auto;
  margin-bottom: var(--space-6);
}

.rs-hero__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
}

.rs-hero__trust {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  flex-wrap: wrap;
}

.rs-hero__trust span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.rs-hero__trust svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-success);
  stroke-width: 2;
  fill: none;
}

/* ═══════════════════════════════════════════════════════════════
 * BREADCRUMB
 * ═══════════════════════════════════════════════════════════════ */

.rs-breadcrumb {
  margin-bottom: var(--space-6);
  display: flex;
  justify-content: center;
}

.rs-breadcrumb__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.rs-breadcrumb__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.rs-breadcrumb__item + .rs-breadcrumb__item::before {
  content: '/';
  color: var(--color-text-disabled);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.rs-breadcrumb__link {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-disabled);
  text-decoration: none;
  transition: color var(--duration-fast);
}

.rs-breadcrumb__link:hover {
  color: var(--color-text-muted);
}

.rs-breadcrumb__current {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════════════════════════
 * SHARED SECTION
 * ═══════════════════════════════════════════════════════════════ */

.rs-section {
  padding-block: var(--space-section);
  border-bottom: 1px solid var(--color-border-default);
}

.rs-section--bg {
  background: var(--color-bg-surface);
}

.rs-section__inner {
  max-width: var(--grid-max);
  margin-inline: auto;
  padding-inline: var(--grid-padding);
}

.rs-section__header {
  margin-bottom: var(--space-10);
  max-width: 700px;
}

.rs-section__header--center {
  margin-inline: auto;
  text-align: center;
}

.rs-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-success);
  margin-bottom: var(--space-2);
}

.rs-heading {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-snug);
  color: var(--color-text-primary);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-2);
}

.rs-subheading {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* ═══════════════════════════════════════════════════════════════
 * 2. LIVE PANEL
 * ═══════════════════════════════════════════════════════════════ */

.rs-live {
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-12);
  box-shadow: var(--shadow-sm);
}

.rs-live__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border-default);
}

.rs-live__title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  color: var(--color-success);
  text-transform: uppercase;
}

.rs-live__dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 0 rgba(45, 84, 56, 0.4);
  animation: rsPulse 2s infinite;
}

@keyframes rsPulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 84, 56, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(45, 84, 56, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 84, 56, 0); }
}

.rs-live__meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.rs-live__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.rs-gauge {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rs-gauge__svg-wrap {
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-3);
  position: relative;
}

.rs-gauge__svg {
  width: 100%;
  height: 100%;
}

.rs-gauge__label {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-1);
}

.rs-gauge__status {
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.rs-gauge__status--ok {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.rs-gauge__status--warn {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.rs-sparkline {
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
}

.rs-sparkline__chart {
  width: 100%;
  height: 80px;
  margin-top: auto;
  margin-bottom: var(--space-2);
}

.rs-live__disclaimer {
  font-size: var(--text-xs);
  color: var(--color-text-disabled);
  text-align: center;
  margin-top: var(--space-6);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
 * 3. PARAMETERS GRID
 * ═══════════════════════════════════════════════════════════════ */

.rs-param-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.rs-param {
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
}

.rs-param--custom {
  background: var(--color-bg-surface);
  border: 1px dashed var(--color-border-strong);
}

.rs-param__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-4);
}

.rs-param__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  color: var(--color-text-primary);
}

.rs-param__tier {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  color: var(--color-text-secondary);
}

.rs-param__tier--research {
  color: var(--color-success);
  border-color: var(--color-success-border);
  background: var(--color-success-bg);
}

.rs-param__name {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.rs-param__range {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.rs-param__sep {
  color: var(--color-border-strong);
}

.rs-param__use {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-snug);
  margin-top: auto;
}

/* ═══════════════════════════════════════════════════════════════
 * 4. INSTITUTIONAL FEATURES
 * ═══════════════════════════════════════════════════════════════ */

.rs-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.rs-feat {
  padding: var(--space-4);
}

.rs-feat__icon {
  width: 32px;
  height: 32px;
  stroke: var(--color-success);
  stroke-width: 1.5;
  fill: none;
  margin-bottom: var(--space-4);
}

.rs-feat__title {
  font-size: var(--text-lg);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  font-weight: var(--weight-medium);
}

.rs-feat__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
}

/* ═══════════════════════════════════════════════════════════════
 * 5. RFQ FORM
 * ═══════════════════════════════════════════════════════════════ */

.rs-rfq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: start;
}

.rs-rfq-info {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-8));
}

.rs-rfq-chips {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.rs-rfq-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.rs-rfq-chip svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-success);
  stroke-width: 2;
  fill: none;
}

/* Form inputs styling relies on global /css/components.css if available,
   otherwise handled here temporarily for form layouts */

.rs-form {
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}

.rs-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.rs-form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.rs-form-field--full {
  grid-column: 1 / -1;
}

.rs-label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-primary);
}

.rs-label abbr {
  color: var(--color-danger, #E53E3E);
  text-decoration: none;
}

.rs-input,
.rs-select,
.rs-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.rs-input:focus,
.rs-select:focus,
.rs-textarea:focus {
  outline: none;
  border-color: var(--color-success);
  box-shadow: 0 0 0 2px rgba(45, 84, 56, 0.2);
}

.rs-textarea {
  min-height: 100px;
  resize: vertical;
}

.rs-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}

.rs-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
}

input[type="checkbox"] {
  accent-color: var(--color-success);
  width: 16px;
  height: 16px;
}

.rs-form-footer {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.rs-privacy {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
}

.rs-form-msg {
  display: none;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.rs-form-msg--success {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════
 * RESPONSIVE
 * ═══════════════════════════════════════════════════════════════ */

@media (max-width: 960px) {
  .rs-rfq-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .rs-rfq-info {
    position: static;
  }
}

@media (max-width: 640px) {
  .rs-hero__title { font-size: var(--text-4xl); }
  .rs-form-grid { grid-template-columns: 1fr; }
  .rs-form { padding: var(--space-5); }
}

/* ═══════════════════════════════════════════════════════════════
 * SCROLL REVEAL
 * ═══════════════════════════════════════════════════════════════ */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-slow) var(--ease-out-expo), transform var(--duration-slow) var(--ease-out-expo);
}

[data-reveal][data-delay="1"] { transition-delay: 80ms; }
[data-reveal][data-delay="2"] { transition-delay: 160ms; }
[data-reveal][data-delay="3"] { transition-delay: 240ms; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
