/* --------------------------------------------------------------------------
   External Libraries - Order matters!
--------------------------------------------------------------------------- */
@import url('https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css');
@import url('https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown-light.min.css');
@import url('https://cdnjs.cloudflare.com/ajax/libs/prism/1.28.0/themes/prism-tomorrow.min.css');

/* --------------------------------------------------------------------------
   Variables
--------------------------------------------------------------------------- */
:root {
  --primary: #0066cc;
  --primary-dark: #0055aa;
  --secondary: #20c997;
  --secondary-dark: #1ab086;
  --accent: #ff7700;
  --text-primary: #333333;
  --text-secondary: #666666;
  --background-primary: #ffffff;
  --background-secondary: #f8f9fa;
  --transition-speed: 0.2s;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* --------------------------------------------------------------------------
   Base & Layout
--------------------------------------------------------------------------- */
body {
  margin: 0;
}

/* Navigation consistency fixes */
nav {
  position: static !important;
}

/* For pages that need proper spacing with nav */
.pt-24 {
  padding-top: 6rem;
}

/* Handle pages that use body padding */
.body-padded {
  padding-top: 0 !important;
}

/* Force forecast page to match docs layout */
.forecast-hero {
  padding-top: 2rem !important;
}

/* --------------------------------------------------------------------------
   Page Load Animation - Prevents flashing elements
--------------------------------------------------------------------------- */
.page-loading {
  opacity: 0;
  visibility: hidden;
}

.page-loaded {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease-in;
}

/* Force logo to maintain consistent dimensions even before fully loaded */
.logo-container {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Buttons
--------------------------------------------------------------------------- */
/* Base button styles */
.btn,
.btn-primary,
.btn-secondary,
.btn-docs {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition-speed);
  text-decoration: none;
  cursor: pointer;
}

/* Primary button */
.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
}
.btn-primary:hover {
  background-color: var(--primary-dark);
}

/* Secondary button */
.btn-secondary {
  background-color: var(--secondary);
  color: white;
  border: none;
}
.btn-secondary:hover {
  background-color: var(--secondary-dark);
}

/* Documentation button */
.btn-docs {
  background-color: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-docs:hover {
  background-color: rgba(0, 102, 204, 0.1);
}

/* --------------------------------------------------------------------------
   Documentation Navigation
--------------------------------------------------------------------------- */
.doc-nav-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-weight: 500;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: background-color var(--transition-speed);
}

.doc-nav-button.active {
  background-color: var(--primary);
  color: white;
}

.doc-nav-button:not(.active) {
  background-color: #f3f4f6;
  color: #374151;
}

.doc-nav-button:not(.active):hover {
  background-color: #e5e7eb;
}

/* --------------------------------------------------------------------------
   Feature Cards
--------------------------------------------------------------------------- */
.feature-card {
  background-color: var(--background-primary);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Code Blocks
--------------------------------------------------------------------------- */
.code-block {
  background-color: #282c34;
  border-radius: 0.5rem;
  padding: 1.5rem;
  overflow-x: auto;
  position: relative;
  margin: 1.5rem 0;
}

pre {
  position: relative;
  margin: 0;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background-color: rgba(255,255,255,0.1);
  color: white;
  border: none;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color var(--transition-speed);
  z-index: 10;
}

.copy-button:hover {
  background-color: rgba(255,255,255,0.2);
}

/* --------------------------------------------------------------------------
   Charts & Visualizations
--------------------------------------------------------------------------- */
.chart-container {
  width: 100%;
  height: 400px;
  background-color: var(--background-secondary);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   GitHub Markdown
--------------------------------------------------------------------------- */
.markdown-body {
  box-sizing: border-box;
  min-width: 200px;
  max-width: 100%;
  margin: 0 auto;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: 24px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.markdown-body table {
  display: block;
  width: 100%;
  overflow: auto;
  margin-top: 0;
  margin-bottom: 16px;
  border-spacing: 0;
  border-collapse: collapse;
}

.markdown-body table th {
  font-weight: 600;
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
}

.markdown-body table td {
  padding: 6px 13px;
  border: 1px solid #dfe2e5;
}

.markdown-body table tr {
  background-color: #fff;
  border-top: 1px solid #c6cbd1;
}

.markdown-body table tr:nth-child(2n) {
  background-color: #f6f8fa;
}

/* --------------------------------------------------------------------------
   Icons
--------------------------------------------------------------------------- */
.github-icon {
  color: #333;
  transition: color var(--transition-speed);
}

.github-icon:hover {
  color: #000;
}

.github-icon svg {
  fill: currentColor;
}

/* --------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--background-primary);
  color: var(--text-secondary);
  border-top: 1px solid #e2e8f0;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.site-footer a {
  color: var(--text-secondary);
  transition: color var(--transition-speed);
}

.site-footer a:hover {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
--------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .feature-grid {
    grid-template-columns: 1fr !important;
  }

  .markdown-body {
    padding: 15px;
  }

  .doc-nav-button {
    margin-bottom: 0.5rem;
    width: 100%;
    text-align: center;
  }
}

@media (min-width: 769px) {
  .markdown-body {
    padding: 45px;
  }
}