/* Robot on Rails - Optimized CSS */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #e67e22;
  --primary-hover: #d35400;
  --secondary-color: #2c3e50;
  --accent-color: #ff8c42;
  --text-dark: #2c3e50;
  --text-medium: #546e7a;
  --text-light: #7f8c8d;
  --bg-light: #f8f9fa;
  --bg-section: #ffffff;
  --border-light: #e9ecef;
  --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-medium: 0 8px 30px rgba(0,0,0,0.12);
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --border-radius: 8px;
  --border-radius-large: 16px;
}

/* Performance optimizations */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Source Sans 3', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: white;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
}

/* Main content area - Centered for carousel and other white sections */
main {
  position: relative;
  background: white;
  margin: 0 20%;
  min-height: auto;
}

/* Header positioning - Full Width */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: transparent;
  backdrop-filter: none;
  z-index: 1000;
  padding: 10px 0;
  border-bottom: none;
  transition: all 0.3s ease;
}

/* Footer styling */
footer {
  background: #3E474E;
  color: #bdc3c7;
  padding: 3rem 0 1rem;
  text-align: center;
  margin: 0;
}

/* Utility classes */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Oxanium', sans-serif;
  margin: 0 0 1rem 0;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-dark);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
  margin: 0 0 1rem 0;
  color: var(--text-medium);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* Header styles - removed duplicate since it's defined above */

header.scrolled {
  background: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-light);
  padding: 2px 0;
  left: 0;
  right: 0;
  width: 100%;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-top: 10px;
}

header.scrolled nav {
  align-items: center;
  padding-top: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: calc(120px * 0.25); /* Gap tied to icon size: 25% of icon height */
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-dark);
  text-decoration: none;
}

header.scrolled .logo {
  align-items: center;
  gap: 1rem; /* Smaller gap when icon is hidden */
}

.logo-icon {
  height: 120px;
  width: auto;
  transition: opacity 0.3s ease;
  flex-shrink: 0; /* Prevent icon from shrinking */
}

.logo-text {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  flex-shrink: 1; /* Allow text to wrap if needed */
  margin-left: calc(120px * 0.1); /* Additional buffer: 10% of icon size */
}

header.scrolled .logo-text {
  align-items: center;
  margin-left: 0; /* Remove buffer when icon is hidden */
}

.logo-robot {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.5rem;
}

.logo-rails {
  font-family: 'Montserrat Underline', sans-serif;
  font-size: 1rem;
}

header.scrolled .logo-icon {
  display: none;
}

header.scrolled .logo-text {
  opacity: 1;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  background: var(--primary-color);
  color: white;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(230, 126, 34, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

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

/* Layout sections */
section {
  padding: 40px 0;
}

/* Removed carousel spacing overrides to restore proper buffer */

.hero {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #fef7f0 0%, #ffb382 100%);
  position: relative;
  padding: 120px 0 100px 0;
  margin: 0;
}

/* Main hero section (with video) needs more space */
.hero.main-hero {
  min-height: 70vh;
  padding: calc(120px + 40px) 0 60px 0; /* Header icon height + buffer */
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  max-width: 1400px;
}

.hero-content {
  max-width: 1000px;
  margin: 0 auto;
}

.hero-video-wrapper {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.hero-video-wrapper .video-hero {
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-medium);
  overflow: hidden;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  color: var(--text-medium);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Feature cards */
.features {
  background: var(--bg-section);
  padding: 100px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-light);
  transition: all var(--transition-medium);
  border: 1px solid var(--border-light);
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-medium);
  border-color: var(--primary-color);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
  font-size: 1.5rem;
}

/* About section (now includes team) */
.about-section {
  background: var(--bg-light);
  margin: 0;
  padding: 40px 0;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.team-card {
  background: white;
  border-radius: var(--border-radius-large);
  overflow: hidden;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-medium);
  text-decoration: none;
  color: inherit;
  display: block;
}

.team-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
  text-decoration: none;
  color: inherit;
}

.member-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  filter: grayscale(100%);
  transition: filter var(--transition-medium);
}

.team-card:hover .member-image {
  filter: grayscale(0%);
}

.member-info {
  padding: 1.5rem;
}

.member-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.member-role {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* FAQ section */
.faq-section {
  background: var(--bg-section);
}

.faq-list {
  max-width: 800px;
  margin: 3rem auto 0;
}

.faq-item {
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  background: white;
  padding: 1.5rem;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question:hover {
  background: var(--bg-light);
}

.faq-answer {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  display: block !important;
  transition: all 0.5s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px !important;
  padding: 1.5rem !important;
  display: block !important;
}

.faq-item.open .faq-answer {
  max-height: 500px !important;
  padding: 1.5rem !important;
  display: block !important;
}

.faq-toggle {
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-toggle {
  transform: rotate(45deg);
}

/* Footer */
footer {
  background: #3E474E;
  color: #bdc3c7;
  padding: 3rem 0 1rem;
  text-align: center;
  margin: 0;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: white;
  margin-bottom: 1rem;
}

.footer-section p,
.footer-section a {
  color: #bdc3c7;
}

.footer-bottom {
  border-top: 1px solid #34495e;
  padding-top: 1rem;
  color: #7f8c8d;
}

/* Responsive design */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  .nav-links {
    display: none;
  }
  
  .features-grid,
  .team-grid {
    grid-template-columns: 1fr;
  }
  
  h2 { font-size: 2rem; }
  h3 { font-size: 1.5rem; }
  
  section { padding: 60px 0; }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .feature-card,
  .team-member {
    margin-bottom: 1rem;
  }
}

/* Loading animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

/* Performance optimizations */
img {
  max-width: 100%;
  height: auto;
  loading: lazy;
}

video {
  max-width: 100%;
  height: auto;
}

/* Focus states for accessibility */
button:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Video optimization styles */
.hero-video {
  padding: 80px 0;
  background: var(--bg-section);
}

.video-hero {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
}

.video-hero iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-large);
}

.video-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--border-radius-large);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-medium);
}

.video-placeholder:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-medium);
}

.video-thumbnail {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(44, 62, 80, 0.8) 0%, rgba(255, 140, 66, 0.8) 100%);
  color: white;
  text-align: center;
}

.play-button {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  transition: all var(--transition-fast);
  border: 3px solid white;
}

.video-placeholder:hover .play-button {
  transform: scale(1.1);
  background: var(--primary-hover);
}

.video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.feature-video-container {
  position: relative;
  aspect-ratio: 16/9;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
  overflow: hidden;
}

.feature-video-container .video-placeholder {
  border-radius: var(--border-radius);
}

.feature-video-container .play-button {
  width: 50px;
  height: 50px;
  font-size: 1.2rem;
}

.feature-video-container .video-thumbnail p {
  display: none;
}

/* Contact section */
.contact-section {
  background: var(--text-dark);
  color: white;
  text-align: center;
}

.contact-section h2 {
  color: white;
  margin-bottom: 2rem;
}

.contact-section p {
  color: #bdc3c7;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.contact-section a {
  color: var(--primary-color);
}

.contact-section a:hover {
  color: white;
}

/* Loading states */
.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  color: white;
}

.spinner {
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 2px solid white;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Article/Post styles */
.post-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: #666;
}

.post-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-image {
  border-radius: 8px;
  max-width: 100%;
  margin: 1rem 0;
}

.post-image.alignright {
  float: right;
  margin: 0 0 1rem 2rem;
  max-width: 300px;
}

.post-image.alignleft {
  float: left;
  margin: 0 2rem 1rem 0;
  max-width: 300px;
}

.post-content p {
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.post-content h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: #2c3e50;
  font-size: 1.8rem;
}

.post-content a {
  color: #e67e22;
  text-decoration: underline;
}

.post-content a:hover {
  color: #d35400;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: #e67e22;
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.highlight-box {
  background: #fff8f0;
  border-left: 4px solid #e67e22;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.text-center {
  text-align: center;
  margin-top: 2rem;
}

/* Insights section styles */
.insights-section {
  background: var(--bg-section);
  padding: 40px 0;
}

.insights-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.insight-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-light);
  transition: all var(--transition-medium);
  border: 1px solid var(--border-light);
}

.insight-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-medium);
  border-color: var(--primary-color);
}

.insight-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.insight-author, .insight-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.insight-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.insight-excerpt {
  margin-bottom: 1.5rem;
  color: var(--text-medium);
}

.read-more {
  color: white;
  font-weight: 600;
  text-decoration: none;
}

.read-more:hover {
  color: #f0f0f0;
}

/* Print styles */
@media print {
  header, footer { display: none; }
  .hero { min-height: auto; }
  section { padding: 20px 0; }
  .video-placeholder { display: none; }
}
