/* ===================================================
   AGROTRADE IA — COMPONENTS (Funcionalidades + extras)
   =================================================== */

/* ===== FUNCIONALIDADES LAYOUT ===== */
.func-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}

.func-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.func-item {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  align-items: flex-start;
}
.func-item:hover {
  background: var(--green-50);
  border-color: var(--green-200);
}
.func-item.active {
  background: var(--green-50);
  border-color: var(--green-300);
}

.fi-icon {
  width: 40px; height: 40px;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-400);
  font-size: .9rem;
  flex-shrink: 0;
  transition: all var(--duration);
}
.func-item.active .fi-icon,
.func-item:hover .fi-icon {
  background: var(--green-600);
  border-color: var(--green-600);
  color: var(--white);
}

.fi-text h4 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 4px;
  transition: color var(--duration);
  font-family: var(--font-display);
  letter-spacing: -.01em;
}
.func-item.active .fi-text h4 { color: var(--green-800); }

.fi-text p {
  font-size: .83rem;
  color: var(--gray-500);
  line-height: 1.65;
  font-weight: 400;
}

/* ===== FUNC VISUAL CARD ===== */
.func-visual {
  position: sticky;
  top: 100px;
}

.fv-card {
  background: var(--gray-900);
  border-radius: var(--radius-xl);
  padding: 28px;
  min-height: 360px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255,255,255,.06);
}
.fv-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(40,197,94,.12) 0%, transparent 70%);
  border-radius: 50%;
}

/* Screens */
.fv-screen {
  display: none;
  flex-direction: column;
  gap: 14px;
  animation: screenIn .3s var(--ease);
}
.fv-screen.active {
  display: flex;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}

.fvs-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.01em;
}
.fvs-title i { color: var(--green-400); }

/* Price rows */
.fvs-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
}
.fvs-grain { font-size: .88rem; color: rgba(255,255,255,.7); font-weight: 500; }
.fvs-val { font-size: .9rem; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.fvs-val.up { color: var(--green-400); }
.fvs-val.down { color: #f87171; }

.fvs-chart {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  padding: 12px;
  overflow: hidden;
}

/* AI card */
.fvs-ai-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: rgba(40,197,94,.08);
  border: 1px solid rgba(40,197,94,.18);
  border-radius: 12px;
}
.fvs-ai-icon {
  width: 36px; height: 36px;
  background: rgba(40,197,94,.15);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--green-400);
  font-size: .9rem;
  flex-shrink: 0;
}
.fvs-ai-text { display: flex; flex-direction: column; gap: 2px; }
.fvs-ai-text strong { font-size: .86rem; color: var(--white); font-weight: 700; font-family: var(--font-display); }
.fvs-ai-text span { font-size: .73rem; color: rgba(255,255,255,.45); }
.fvs-ai-text p { font-size: .76rem; color: rgba(255,255,255,.55); line-height: 1.5; margin-top: 4px; font-weight: 400; }

.fvs-confidence {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .78rem;
  color: rgba(255,255,255,.5);
}
.fvs-bar { flex: 1; height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.fvs-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green-600), var(--green-400)); border-radius: 3px; transition: width .8s var(--ease); }

/* Tag */
.fvs-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: rgba(255,255,255,.35);
  margin-top: auto;
}
.fvs-tag.success { color: var(--green-400); }

/* Marketplace */
.fvs-offer {
  padding: 12px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fvo-header { display: flex; align-items: center; gap: 8px; }
.fvo-badge {
  font-size: .62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.fvo-badge.buy { background: rgba(40,197,94,.15); color: var(--green-400); }
.fvo-badge.sell { background: rgba(250,204,21,.12); color: #fbbf24; }
.fvo-grain { font-size: .82rem; color: rgba(255,255,255,.7); font-weight: 600; }
.fvo-price { font-size: .92rem; font-weight: 800; color: var(--white); font-family: var(--font-display); letter-spacing: -.02em; }
.fvo-info { font-size: .72rem; color: rgba(255,255,255,.4); }
.fvo-company { font-size: .72rem; color: rgba(255,255,255,.5); display: flex; align-items: center; gap: 4px; }
.fvo-company i { color: #fbbf24; font-size: .65rem; }

/* Alerts */
.fvs-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
}
.fvs-alert-item i { font-size: .85rem; color: rgba(255,255,255,.25); margin-top: 2px; flex-shrink: 0; }
.fvs-alert-item.active-alert { background: rgba(40,197,94,.07); border-color: rgba(40,197,94,.15); }
.fvs-alert-item.active-alert i { color: var(--green-400); }
.fvs-alert-item div { display: flex; flex-direction: column; gap: 2px; }
.fvs-alert-item strong { font-size: .83rem; color: var(--white); font-weight: 600; font-family: var(--font-display); }
.fvs-alert-item span { font-size: .7rem; color: rgba(255,255,255,.4); font-weight: 400; }

/* History */
.fvs-hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
}
.fhi-left { display: flex; flex-direction: column; gap: 2px; }
.fhi-left strong { font-size: .83rem; color: var(--white); font-weight: 600; font-family: var(--font-display); }
.fhi-left span { font-size: .7rem; color: rgba(255,255,255,.4); font-weight: 400; }
.fhi-right { text-align: right; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.fhi-val { font-size: .82rem; color: var(--white); font-weight: 700; }
.fhi-status { font-size: .65rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-full); }
.fhi-status.ok { background: rgba(40,197,94,.15); color: var(--green-400); }

/* ===== MOBILE FUNC ===== */
@media (max-width: 860px) {
  .func-layout { grid-template-columns: 1fr; gap: 32px; }
  .func-visual { position: static; }
  .fv-card { min-height: 280px; }
}

/* ===== SCROLL TO TOP ===== */
.scroll-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--green-600), var(--green-800));
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  box-shadow: var(--shadow-green);
  opacity: 0; pointer-events: none;
  transition: opacity var(--duration), transform var(--duration);
  z-index: 100;
}
.scroll-top.visible {
  opacity: 1; pointer-events: all;
}
.scroll-top:hover {
  transform: translateY(-3px);
}
