/* Custom CSS for Beyond Quality - Recreating the Lovable design */
/* Cache bust: v8.0 - Removed date functionality completely */

/* CSS Variables for Design System */
:root {
  /* Colors */
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --border: 214.3 31.8% 91.4%;
  --card-background: 0 0% 100%;
  --hover-border: 214.3 31.8% 78.4%;
  
  /* Typography */
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  
  /* Spacing */
  --container-max-width: 896px;
  --section-spacing: 3rem;
  
  /* Border radius */
  --radius: 0.5rem;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* Navigation */
.nav {
  border-bottom: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.nav-brand {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-brand:hover {
  color: hsl(var(--muted-foreground));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 400;
}

.nav-link:hover,
.nav-link.active {
  color: hsl(var(--foreground));
}

/* Main Content */
.main-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin: 0 0 1.5rem 0;
  color: hsl(var(--foreground));
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Section headings - consistent smaller size */
.section h2,
.grid h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

p {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  line-height: 1.7;
}

/* Links */
a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  transition: color 0.2s ease;
}

a:hover {
  color: hsl(var(--muted-foreground));
}

/* Cards */
.card {
  background-color: hsl(var(--card-background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
  margin-bottom: 1rem;
}

.card:hover {
  border-color: hsl(var(--hover-border));
}

.card-content {
  padding: 1rem 0 1rem 1.2rem;
}

.card-header {
  padding: 1.5rem 1.5rem 0.75rem 1.5rem;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 400;
  color: hsl(var(--foreground));
  margin: 0;
}

.card-description {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin: 0.75rem 0 0 0;
}

/* Sections */
.section {
  margin-bottom: var(--section-spacing);
}

.section-large {
  margin-bottom: 2.5rem;
}

/* Apply section styles to tab panels */
.tab-panel.section-large {
  margin-bottom: 0;
}

/* About Section */
.about-content {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.about-content p {
  margin-bottom: 1rem;
}

/* Episode Description */
.episode-description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  font-style: italic;
  font-weight: 500;
}

/* Podcast Section */
.podcast-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /*padding: 0.5rem;*/
}

/* Podcast Links */
.podcast-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}

.podcast-links a {
  text-decoration: underline;
  transition: color 0.2s ease;
}

.podcast-links a:hover {
  color: hsl(var(--foreground));
}

/* Embedded YouTube Player */
.podcast-player {
  width: 100%;
  margin-bottom: 0;
}

#episode-description {
  margin-top: 1rem;
}

.youtube-embed-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

.youtube-embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}




/* Research Cards */
.research-title {
  font-size: 1.125rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

/* Footer */
.footer {
  border-top: 1px solid hsl(var(--border));
  padding: 2rem 0;
  margin-top: 0;
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  margin-bottom: 1.5rem;
}

.footer-sponsors {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.sponsor {
  font-size: 1.125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

/* GitHub Discussions Integration */
#github-discussions {
  margin-top: 1rem;
}

.discussion-item {
  background-color: hsl(var(--card-background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}

.discussion-item:hover {
  border-color: hsl(var(--hover-border));
}

.discussion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.discussion-category {
  display: none;
  background-color: #f8fafc;
  color: hsl(var(--muted-foreground));
  padding: 0.25rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.discussion-date {
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

#github-discussions .discussion-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 400;
  font-family: var(--font-serif) !important;
}

#github-discussions .discussion-title a {
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: color 0.2s ease;
  font-family: var(--font-serif) !important;
  font-weight: 400 !important;
  font-size: 1.125rem !important;
}

.discussion-title a:hover {
  color: hsl(var(--muted-foreground));
  text-decoration: underline;
}

.discussion-body {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.discussion-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.discussion-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.author-avatar {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
}

.discussion-stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.upvotes, .answers {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.discussions-loading,
.discussions-error {
  text-align: center;
  padding: 2rem;
  color: hsl(var(--muted-foreground));
}

.discussions-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
}

.discussions-error a {
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: color 0.2s ease;
}

.discussions-error a:hover {
  color: hsl(var(--muted-foreground));
  text-decoration: underline;
}

/* Responsive design for discussions */
@media (max-width: 768px) {
  .discussion-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .discussion-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* Tabbed Interface */
.tabbed-interface {
  margin-bottom: 2rem;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-button {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.tab-button:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
}

.tab-button.active {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--foreground));
  background-color: hsl(var(--background));
}

.tab-content {
  position: relative;
  background-color: hsl(0 0% 98%);
  border-radius: var(--radius);
  padding: 1rem 2rem 1rem 1rem;
  margin-top: 0;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.active {
  display: block;
}

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


/* Responsive Design */
@media (min-width: 768px) {
  .tab-nav {
    overflow-x: visible;
    margin-bottom: 0;
  }
}


@media (max-width: 767px) {
  .nav-container {
    flex-direction: column;
    height: auto;
    padding: 1rem 1.5rem;
  }
  
  .nav-links {
    margin-top: 1rem;
    gap: 1.5rem;
  }
  
  /* Mobile navigation text replacement */
  .nav-link[data-mobile] {
    font-size: 0;
  }

  .card-content { padding-right: 1rem; }
  
  .nav-link[data-mobile]::after {
    content: attr(data-mobile);
    font-size: 0.875rem;
    font-weight: 400;
    color: hsl(var(--muted-foreground));
    transition: color 0.2s ease;
  }
  
  .nav-link[data-mobile]:hover::after,
  .nav-link[data-mobile].active::after {
    color: hsl(var(--foreground));
    font-weight: 500;
  }
  
  .footer-sponsors {
    gap: 2rem;
  }
  
  
  /* Mobile tabbed interface optimizations */
  .tab-nav {
    padding: 0 0.5rem;
    margin-bottom: 1.5rem;
  }
  
  .tab-button {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    min-width: auto;
  }
  
  .tabbed-interface {
    margin-bottom: 3rem;
  }
  
  /* Mobile optimizations */
  .youtube-embed-container {
    margin-bottom: 1rem;
  }
  
  /* Keep podcast links in one line on mobile with better spacing */
  .podcast-links {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
  }
  
  .podcast-links span {
    margin-right: 0.5rem;
  }
  
  .podcast-links a {
    display: inline;
    padding: 0;
    border-bottom: none;
    width: auto;
    text-align: left;
    white-space: nowrap;
  }
  
}