/* Garvins Falls Village - Documentation Portal Styles */
/* Forest Green Theme — Site-Wide Beautification */

/* ── Google Font ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Base ────────────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background-color: #f8faf8;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #888; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── Header ──────────────────────────────────────── */
.app-header {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  min-height: 160px;
}

.app-header-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.35);
}

.app-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(20, 83, 45, 0.85) 0%, rgba(21, 128, 61, 0.7) 100%);
}

.app-header-content {
  position: relative;
  z-index: 10;
  color: white;
}

.app-header h1 {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  color: white;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-header p {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.header-stat {
  text-align: center;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  backdrop-filter: blur(4px);
}

.header-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.header-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

/* ── Banner Rotator ──────────────────────────────── */
.banner-slide {
  position: absolute;
  top: 0; left: 0; right: 0;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
}
.banner-slide[style*="opacity: 1"], .banner-slide[style*="opacity:1"] {
  pointer-events: auto;
}
.banner-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s, transform 0.3s;
}
.banner-dot:hover { background: rgba(255,255,255,0.7); }
.banner-dot.active {
  background: white;
  transform: scale(1.3);
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar-header {
  background: linear-gradient(135deg, #14532d, #166534);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
  margin: -1rem -1rem 1rem -1rem;
  font-weight: 600;
}

/* ── Navigation ──────────────────────────────────── */
.doc-nav-item {
  border-left: 3px solid transparent;
  transition: all 0.2s ease, border-left-color 0.25s ease;
  position: relative;
  border-radius: 0 0.375rem 0.375rem 0;
}

.doc-nav-item:hover {
  border-left-color: #16a34a;
  background-color: rgba(22, 163, 74, 0.08);
  padding-left: 0.75rem;
}

.doc-nav-item.active {
  border-left-color: #15803d;
  background-color: rgba(21, 128, 61, 0.12);
  font-weight: 600;
  padding-left: 0.75rem;
}

/* ── Tab Navigation ──────────────────────────────── */
.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #15803d;
  background-color: rgba(22, 163, 74, 0.05);
}

.tab-btn.active {
  color: #15803d;
  border-bottom-color: #15803d;
  background-color: rgba(22, 163, 74, 0.08);
}

.tab-btn.active-lyndaai {
  color: #059669;
  border-bottom-color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
}

.tab-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #15803d, #166534);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(21, 128, 61, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #166534, #14532d);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(21, 128, 61, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(21, 128, 61, 0.3);
}

/* ── Cards (site-wide hover) ─────────────────────── */
.card, .bg-white.shadow.rounded-lg, .bg-white.shadow-md {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover, .bg-white.shadow.rounded-lg:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

/* ── Main content area ───────────────────────────── */
.bg-white.shadow.rounded-lg {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 10px 15px rgba(0, 0, 0, 0.025);
  margin-top: 0;
}

#content-area {
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: #fff;
}

/* ── Results ─────────────────────────────────────── */
.result-item {
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.result-item:hover {
  border-left-color: #16a34a;
}

.ai-response {
  border-left: 4px solid #16a34a;
}

/* ── Loading animations ──────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 0.3; }
}

.loading-pulse {
  animation: pulse 1.5s infinite;
}

/* ── Markdown styling ────────────────────────────── */
.markdown-body { color: #24292e; }
.markdown-body h1 { font-size: 2em; margin-top: 1em; margin-bottom: 0.5em; font-weight: bold; padding-bottom: 0.3em; border-bottom: 1px solid #eaecef; }
.markdown-body h2 { font-size: 1.5em; margin-top: 1em; margin-bottom: 0.5em; font-weight: bold; padding-bottom: 0.3em; border-bottom: 1px solid #eaecef; }
.markdown-body h3 { font-size: 1.25em; margin-top: 1em; margin-bottom: 0.5em; font-weight: bold; }
.markdown-body h4 { font-size: 1em; margin-top: 1em; margin-bottom: 0.5em; font-weight: bold; }
.markdown-body p { margin-bottom: 1em; }
.markdown-body ul { list-style-type: disc; margin-left: 2em; margin-bottom: 1em; }
.markdown-body ol { list-style-type: decimal; margin-left: 2em; margin-bottom: 1em; }
.markdown-body li { margin-bottom: 0.25em; }
.markdown-body table { border-collapse: collapse; margin-bottom: 1em; width: 100%; overflow: auto; display: block; }
.markdown-body table th { font-weight: 600; background-color: #f0fdf4; }
.markdown-body table td, .markdown-body table th { border: 1px solid #dfe2e5; padding: 0.5em 1em; }
.markdown-body table tr { background-color: #fff; border-top: 1px solid #c6cbd1; }
.markdown-body table tr:nth-child(2n) { background-color: #f0fdf4; }
.markdown-body code { background: #f0fdf4; padding: 0.2em 0.4em; border-radius: 3px; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; font-size: 85%; }
.markdown-body pre { background: #f6f8fa; padding: 1em; overflow-x: auto; margin-bottom: 1em; border-radius: 3px; font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; }
.markdown-body blockquote { padding: 0 1em; color: #6a737d; border-left: 0.25em solid #16a34a; margin-bottom: 1em; }
.markdown-body hr { height: 0.25em; padding: 0; margin: 24px 0; background-color: #e1e4e8; border: 0; }

/* ── Charts ──────────────────────────────────────── */
.chart-container {
  min-height: 300px;
  margin-bottom: 2.5rem;
  position: relative;
  padding: 1.5rem;
  overflow: visible;
}

.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.chart-legend-item { display: flex; align-items: center; font-size: 0.875rem; }
.chart-legend-color { width: 12px; height: 12px; border-radius: 2px; margin-right: 0.5rem; }

/* ── Media Gallery ───────────────────────────────── */
.media-gallery { --gallery-height: 400px; }
.media-gallery img { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.media-gallery .relative:not(.fixed) { height: var(--gallery-height); }
.media-gallery .relative.fixed img { max-height: calc(100vh - 120px); max-width: calc(100vw - 40px); }
.media-gallery button:hover img { transform: scale(1.02); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); }
.media-gallery button svg { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3)); }

#media-info { animation: fadeIn 0.3s ease-in-out; }

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

.media-loading {
  height: var(--gallery-height);
  background: linear-gradient(110deg, #f0fdf4 30%, #dcfce7 50%, #f0fdf4 70%);
  background-size: 200% 100%;
  animation: mediaLoadingShimmer 1.5s infinite linear;
}

@keyframes mediaLoadingShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Toggle switch ───────────────────────────────── */
input[type="checkbox"] { height: 0; width: 0; visibility: hidden; position: absolute; }

label.block.overflow-hidden.h-6.rounded-full,
label[for="visualization-toggle"] {
  position: relative; display: block; width: 48px; height: 24px;
  background-color: #e2e8f0; border-radius: 12px;
  transition: background-color 0.3s ease; cursor: pointer !important; overflow: hidden;
}

input[type="checkbox"] + span,
label[for="visualization-toggle"] span {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background-color: #15803d !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, background-color 0.3s ease; transform: translateX(0);
}

input[type="checkbox"]:checked + span { transform: translateX(24px); background-color: #166534 !important; }
input[type="checkbox"]:checked ~ label.block.overflow-hidden.h-6.rounded-full,
input[type="checkbox"]:checked + label[for="visualization-toggle"] { background-color: #15803d !important; }

.flex.items-center span.mr-2.text-sm.text-gray-600 { color: #4b5563 !important; font-weight: 500; }

/* ── Tab panel animations ────────────────────────── */
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-panel:not(.hidden) { animation: tabFadeIn 0.3s ease-out; }

/* ── Lynda-AI (mint/emerald identity) ────────────── */
.lynda-avatar {
  position: relative;
  transition: transform 0.5s ease;
}

.lynda-avatar:hover { transform: scale(1.05); }

.lynda-avatar:after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%; box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  opacity: 0; transition: opacity 0.5s ease;
}

.lynda-avatar:hover:after { opacity: 1; }

@keyframes lyndaThinking {
  0% { transform: scale(0.8); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.3; }
}

.lynda-loader {
  width: 20px; height: 20px; background-color: #10b981;
  border-radius: 50%; display: inline-block;
  animation: lyndaThinking 1.5s infinite ease-in-out;
}

.lynda-loader:nth-child(1) { animation-delay: 0s; }

@keyframes pulse-mint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
}

#panel-lyndaai { animation: tabFadeIn 0.3s ease-in-out; }

#tab-lyndaai:hover { color: #047857; }
#lyndaai-query:focus { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }

/* ── Toggle hover ────────────────────────────────── */
label[for="visualization-toggle"]:hover { background-color: #d1d5db !important; }
input[type="checkbox"]:checked + label[for="visualization-toggle"]:hover { background-color: #166534 !important; }
.flex.items-center span.mr-2.text-sm.text-gray-600:hover { color: #14532d !important; }

/* ── Footer ──────────────────────────────────────── */
.site-footer {
  background: linear-gradient(135deg, #14532d, #166534);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 0.75rem;
  margin-top: 2rem;
}

.site-footer a {
  color: #86efac;
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer a:hover {
  color: #fff;
}

/* ── Financial summary cards accent ──────────────── */
.bg-gray-50.p-4.rounded-lg,
.bg-gray-50.p-3.rounded-lg {
  border-left: 3px solid #16a34a;
  transition: all 0.2s ease;
}

.bg-gray-50.p-4.rounded-lg:hover,
.bg-gray-50.p-3.rounded-lg:hover {
  border-left-color: #15803d;
  background-color: #f0fdf4;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .markdown-body table { display: block; overflow-x: auto; }
  .chart-container { min-height: 350px; margin-bottom: 3rem; }
  .media-gallery .relative:not(.fixed) { height: 300px; }
  .media-gallery button { transform: scale(0.9); }
  .tab-btn { padding: 0.5rem 0.625rem; font-size: 0.75rem; }
  .tab-btn svg { width: 0.875rem; height: 0.875rem; }
  .header-stats { flex-wrap: wrap; }
  .app-header { min-height: 140px; }
}

@media (max-width: 992px) {
  #panel-lyndaai .flex-col.lg\:flex-row { gap: 2rem; }
  #panel-lyndaai .lg\:w-1\/4 { margin-bottom: 2rem; }
}
