/* ========================================================
   SiBot UIS - Universitas Ibnu Sina
   Palette: Hijau #1B5E20, Emas #FFC107
   ======================================================== */

:root {
  --uis-green: #1B5E20;
  --uis-green-light: #2E7D32;
  --uis-green-dark: #0D3B12;
  --uis-gold: #FFC107;
  --uis-gold-light: #FFD54F;
  --uis-cream: #FFF8E1;
  --bg-soft: #F8F9FA;
  --text-dark: #1A1A1A;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-soft);
  color: var(--text-dark);
  line-height: 1.6;
}

a { color: var(--uis-green); text-decoration: none; }
a:hover { color: var(--uis-green-light); }

/* ========================================================
   NAVBAR
   ======================================================== */
.navbar {
  background: linear-gradient(135deg, var(--uis-green) 0%, var(--uis-green-light) 100%);
  color: white;
  padding: 0.9rem 2rem;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-weight: 700;
  font-size: 1.15rem;
}

.navbar-brand img {
  width: 42px;
  height: 42px;
}

.navbar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.navbar-brand-text .small {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.navbar-menu a {
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background 0.2s;
  font-size: 0.95rem;
  font-weight: 500;
}

.navbar-menu a:hover, .navbar-menu a.active {
  background: rgba(255, 193, 7, 0.25);
  color: var(--uis-gold-light);
}

/* ========================================================
   LAYOUT
   ======================================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  color: var(--uis-green);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ========================================================
   CARDS
   ======================================================== */
.card {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  color: var(--uis-green);
  font-size: 1.15rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ========================================================
   METRICS / STATS
   ======================================================== */
.metric {
  background: white;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--uis-gold);
  box-shadow: var(--shadow-sm);
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.metric-value {
  color: var(--uis-green);
  font-size: 1.75rem;
  font-weight: 700;
}

.metric-delta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.metric-delta.positive { color: var(--success); }
.metric-delta.negative { color: var(--danger); }

/* ========================================================
   BUTTONS
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--uis-green);
  color: white;
}

.btn-primary:hover {
  background: var(--uis-green-light);
  color: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-gold {
  background: var(--uis-gold);
  color: var(--uis-green-dark);
}

.btn-gold:hover {
  background: var(--uis-gold-light);
  color: var(--uis-green-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: white;
  color: var(--uis-green);
  border: 2px solid var(--uis-green);
}

.btn-outline:hover {
  background: var(--uis-green);
  color: white;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ========================================================
   FORMS
   ======================================================== */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.form-control, .form-select, input[type="text"], input[type="number"], textarea, select {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
  transition: border 0.2s, box-shadow 0.2s;
}

.form-control:focus, .form-select:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--uis-green);
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.form-range {
  width: 100%;
  accent-color: var(--uis-green);
}

.form-helper {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ========================================================
   LANDING / HERO
   ======================================================== */
.hero {
  background: linear-gradient(135deg, var(--uis-green) 0%, var(--uis-green-dark) 100%);
  color: white;
  padding: 5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,193,7,0.1) 0%, transparent 60%);
  animation: rotate 30s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero img {
  width: 100px;
  height: 100px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--uis-gold); }

.hero p {
  font-size: 1.15rem;
  opacity: 0.92;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

/* Feature Cards */
.section {
  padding: 4rem 2rem;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  color: var(--uis-green);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-title p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.feature-card {
  background: white;
  border-radius: 14px;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--uis-gold);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: var(--uis-cream);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.8rem;
}

.feature-card h3 {
  color: var(--uis-green);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ========================================================
   CHAT
   ======================================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 90px - 4rem);
}

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
}

.chat-sidebar {
  background: white;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow-y: auto;
}

.chat-sidebar h3 {
  color: var(--uis-green);
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--uis-gold);
}

.chat-main {
  background: white;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

.chat-header {
  background: linear-gradient(135deg, var(--uis-green) 0%, var(--uis-green-light) 100%);
  color: white;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header-avatar {
  width: 40px;
  height: 40px;
  background: var(--uis-gold);
  color: var(--uis-green-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.chat-header-info h4 { font-size: 1rem; }
.chat-header-info .status {
  font-size: 0.8rem;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-header-info .status::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #4CAF50;
  border-radius: 50%;
  display: inline-block;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message {
  max-width: 75%;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-bot {
  align-self: flex-start;
}

.message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.message-bot .message-avatar {
  background: var(--uis-green);
  color: var(--uis-gold);
}

.message-user .message-avatar {
  background: var(--uis-gold);
  color: var(--uis-green-dark);
}

.message-bubble {
  background: white;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.message-user .message-bubble {
  background: var(--uis-green);
  color: white;
  border-color: var(--uis-green);
}

.message-bubble p { margin-bottom: 0.5rem; }
.message-bubble p:last-child { margin-bottom: 0; }

.message-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-user .message-meta { justify-content: flex-end; color: rgba(255,255,255,0.85); }

.confidence-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--uis-cream);
  color: var(--uis-green-dark);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.confidence-badge.high { background: #D1FAE5; color: #065F46; }
.confidence-badge.low { background: #FEE2E2; color: #991B1B; }

.message-detail {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.message-detail summary {
  cursor: pointer;
  color: var(--text-muted);
  font-weight: 600;
}

.message-detail-content {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-soft);
  border-radius: 8px;
}

.alt-list {
  list-style: none;
  margin-top: 0.4rem;
}

.alt-list li {
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.alt-list li strong { color: var(--uis-green); }

.chat-input {
  border-top: 1px solid var(--border);
  padding: 1rem;
  background: white;
  display: flex;
  gap: 0.5rem;
}

.chat-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-size: 0.95rem;
}

.chat-input input:focus {
  outline: none;
  border-color: var(--uis-green);
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

.chat-input button {
  background: var(--uis-green);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 0 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-input button:hover { background: var(--uis-green-light); }
.chat-input button:disabled { background: var(--border); cursor: not-allowed; }

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.5rem;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--uis-green);
  border-radius: 50%;
  animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ========================================================
   TABLES
   ======================================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table thead {
  background: var(--uis-green);
  color: white;
}

.table th, .table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:hover {
  background: var(--bg-soft);
}

.table tbody tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: var(--uis-cream);
  color: var(--uis-green-dark);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ========================================================
   FOOTER
   ======================================================== */
.footer {
  background: var(--uis-green-dark);
  color: white;
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

.footer p { opacity: 0.85; font-size: 0.9rem; }
.footer .gold { color: var(--uis-gold); font-weight: 600; }

/* ========================================================
   UTILITIES
   ======================================================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.flex { display: flex; align-items: center; gap: 0.75rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }

.alert {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border-left: 4px solid;
}

.alert-success { background: #D1FAE5; color: #065F46; border-color: var(--success); }
.alert-warning { background: #FEF3C7; color: #92400E; border-color: var(--warning); }
.alert-info { background: var(--uis-cream); color: var(--uis-green-dark); border-color: var(--uis-gold); }
.alert-danger { background: #FEE2E2; color: #991B1B; border-color: var(--danger); }
