/* Unified Template Styles - For Both Project Pages and Documentation Pages */

/* Custom Scrollbar Styling - Red scroll as preferred */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  box-shadow: inset 0 0 2px grey;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: red;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #04c7d1;
}

/* Typography */
body, h1, h2 {
  font-family: 'Bungee', sans-serif !important;
}

h3, h4, h5, h6, p {
  font-family: "Aleo", serif;
}

/* Global Link Styling - Remove underlines, add hover color */
a {
  text-decoration: none !important;
  color: inherit;
  transition: color 0.2s ease;
}

a:hover {
  color: #04c7d1 !important;
  text-decoration: none !important;
}

/* ========================================
   PROJECTS PAGE STYLES
   ======================================== */

/* Projects Container */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin: 40px 0;
  padding: 0 20px;
}

/* Project Card */
.project-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #e9ecef;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.project-card a {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

/* Project Image */
.project-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

/* Project Content */
.project-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: calc(100% - 250px);
}

.project-content h3 {
  color: #2c3e50;
  margin: 0 0 15px 0;
  font-size: 1.3em;
  font-weight: bold;
}

/* Project tags */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.project-tag {
  background-color: #2c3e50;
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 500;
  font-family: "Aleo", serif;
  white-space: nowrap;
}

.project-content p {
  color: #666;
  font-size: 0.9em;
  line-height: 1.5;
  margin: 0;
  flex-grow: 1;
  font-weight: normal;
}

/* Filter and search section */
.filter-section {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border-left: 4px solid #2c3e50;
}

.filter-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.filter-btn {
  background-color: white;
  color: #333;
  border: 2px solid #e9ecef;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Aleo", serif;
  font-size: 0.9em;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: #2c3e50;
  color: white;
  border-color: #2c3e50;
}

.search-section {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  text-align: center;
}

.search-section h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.search-input {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1em;
  font-family: "Aleo", serif;
  transition: border-color 0.3s ease;
  margin: 0 auto;
  display: block;
}

.search-input:focus {
  outline: none;
  border-color: #2c3e50;
}

/* ========================================
   DOCUMENTATION PAGE STYLES (5-Section Layout)
   ======================================== */

/* Main container with 5-section layout */
.main-container {
  display: grid;
  grid-template-columns: 1fr 3fr 1fr; /* Left: 1 part, Center: 3 parts, Right: 1 part */
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 100px);
}

/* Left Sidebar - Links and Downloads */
.left-sidebar {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 120px;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.nav-arrows {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.nav-arrow img {
  width: 30px;
  height: auto;
  transition: transform 0.2s ease;
}

.nav-arrow:hover img {
  transform: scale(1.1);
}

.resource-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-button {
  background-color: #04c7d1;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-align: center;
}

.resource-button:hover {
  background-color: #03a9b3;
}

.resource-button a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

.links-section, .downloads-section {
  border-top: 2px solid #e9ecef;
  padding-top: 15px;
}

.links-section h3, .downloads-section h3 {
  color: #04c7d1;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.links-section ul, .downloads-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.links-section li, .downloads-section li {
  margin-bottom: 8px;
}

.links-section a, .downloads-section a {
  color: #333;
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.2s ease;
}

.links-section a:hover, .downloads-section a:hover {
  color: #04c7d1;
}

/* Center Content - Main project content */
.center-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

.content-wrapper {
  padding: 30px;
}

.content-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #e9ecef;
}

.content-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.content-section h1 {
  color: #f90303;
  font-size: 2.5em;
  margin-bottom: 20px;
}

.content-section h2 {
  color: #04c7d1;
  font-size: 1.8em;
  margin-bottom: 15px;
  margin-top: 30px;
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section p {
  line-height: 1.6;
  margin-bottom: 15px;
  color: #333;
}

.content-section ul {
  margin-bottom: 15px;
  padding-left: 20px;
}

.content-section li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.hero-image {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.hero-description {
  font-size: 1.1em;
  font-style: italic;
  color: #666;
  text-align: center;
  margin-top: 15px;
}

/* Right Sidebar - Table of Contents */
.right-sidebar {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 120px;
}

.toc-content h3 {
  color: #04c7d1;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.toc-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 25px 0;
}

.toc-nav li {
  margin-bottom: 8px;
}

.toc-nav a {
  color: #333;
  text-decoration: none;
  font-size: 0.9em;
  padding: 5px 10px;
  display: block;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.toc-nav a:hover {
  background-color: #04c7d1;
  color: white;
}

.quick-info {
  border-top: 2px solid #e9ecef;
  padding-top: 15px;
  margin-bottom: 20px;
}

.quick-info h4 {
  color: #04c7d1;
  margin-bottom: 10px;
  font-size: 1em;
}

.quick-info p {
  margin-bottom: 8px;
  font-size: 0.85em;
  color: #666;
}

/* BOM (Bill of Materials) Table Styling */
.bom-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.bom-table th {
  background-color: #04c7d1;
  color: white;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 0.9em;
  border-bottom: 2px solid #03a9b3;
  font-family: "Aleo", serif;
}

.bom-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e9ecef;
  font-size: 0.85em;
  vertical-align: top;
  font-weight: 400;
  font-family: "Aleo", serif;
}

.bom-table tr:hover {
  background-color: #f8f9fa;
}

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

/* BOM Table Column Widths */
.bom-table th:nth-child(1), .bom-table td:nth-child(1) { /* Item # */
  width: 8%;
  text-align: center;
}

.bom-table th:nth-child(2), .bom-table td:nth-child(2) { /* Ref. */
  width: 12%;
  text-align: center;
}

.bom-table th:nth-child(3), .bom-table td:nth-child(3) { /* Comp # */
  width: 15%;
  text-align: center;
}

.bom-table th:nth-child(4), .bom-table td:nth-child(4) { /* Description */
  width: 35%;
}

.bom-table th:nth-child(5), .bom-table td:nth-child(5) { /* Package */
  width: 15%;
  text-align: center;
}

.bom-table th:nth-child(6), .bom-table td:nth-child(6) { /* Link */
  width: 15%;
  text-align: center;
}

.bom-table a {
  color: #04c7d1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.bom-table a:hover {
  color: #03a9b3;
  text-decoration: none;
}

/* BOM Section Styling */
.bom-section {
  margin: 30px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #04c7d1;
}

.bom-section h3 {
  color: #04c7d1;
  margin-bottom: 15px;
  font-size: 1.3em;
}

.bom-section p {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 15px;
}

/* ========================================
   SHARED COMPONENTS
   ======================================== */

/* Back to Top Button */
.button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #04c7d1;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
  z-index: 1000;
}

.button:hover {
  background-color: #03a9b3;
}

.button a {
  color: white;
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Mobile responsive fixes for projects page */
@media screen and (max-width: 768px) {
  .projects-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 0 10px;
  }
  
  .project-image {
    height: 200px;
  }
  
  .project-content {
    height: calc(100% - 200px);
    padding: 15px;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  /* Documentation page responsive */
  .main-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .left-sidebar, .right-sidebar {
    position: static;
    order: 2;
  }
  
  .center-content {
    order: 1;
  }
  
  .left-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  .search-section {
    grid-column: 1 / -1;
  }
}

@media screen and (max-width: 480px) {
  .projects-container {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 0 5px;
  }
  
  .project-image {
    height: 180px;
  }
  
  .project-content {
    height: calc(100% - 180px);
    padding: 12px;
  }
  
  .filter-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .project-content h3 {
    font-size: 1.2em;
  }
  
  /* Documentation page mobile */
  .main-container {
    padding: 10px;
    gap: 15px;
  }
  
  .content-wrapper {
    padding: 20px;
  }
  
  .left-sidebar {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .content-section h1 {
    font-size: 2em;
  }
  
  .content-section h2 {
    font-size: 1.5em;
  }
  
  .left-sidebar, .right-sidebar {
    padding: 15px;
  }
  
  .content-section h1 {
    font-size: 1.8em;
  }
  
  .content-section h2 {
    font-size: 1.3em;
  }
}

/* Responsive BOM Table */
@media (max-width: 768px) {
  .bom-table {
    font-size: 0.8em;
  }
  
  .bom-table th, .bom-table td {
    padding: 8px 4px;
  }
  
  .bom-table th:nth-child(4), .bom-table td:nth-child(4) { /* Description */
    width: 40%;
  }
  
  .bom-table th:nth-child(5), .bom-table td:nth-child(5) { /* Package */
    width: 12%;
  }
  
  .bom-table th:nth-child(6), .bom-table td:nth-child(6) { /* Link */
    width: 13%;
  }
}

@media (max-width: 480px) {
  .bom-table {
    font-size: 0.7em;
  }
  
  .bom-table th, .bom-table td {
    padding: 6px 2px;
  }
  
  /* Stack table on very small screens */
  .bom-table, .bom-table thead, .bom-table tbody, .bom-table th, .bom-table td, .bom-table tr {
    display: block;
  }
  
  .bom-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
  
  .bom-table tr {
    border: 1px solid #ccc;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    background: white;
  }
  
  .bom-table td {
    border: none;
    position: relative;
    padding-left: 50%;
    text-align: left;
  }
  
  .bom-table td:before {
    content: attr(data-label);
    position: absolute;
    left: 6px;
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    font-weight: bold;
    color: #04c7d1;
  }
}

/* Animation for project cards */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.project-card {
  animation: fadeInUp 0.6s ease-out;
}

/* Focus states for accessibility */
.filter-btn:focus,
.search-input:focus {
  outline: 2px solid #2c3e50;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .project-card {
    border: 2px solid #000;
  }
  
  .filter-btn {
    border: 2px solid #000;
  }
  
  .search-input {
    border: 2px solid #000;
  }
}
