/* TrailCharge Website Styles */

/* CSS Variables for Brand Colors */
:root {
  --forest: #0F5B4F;
  --trail-orange: #FF7A3D;
  --cream: #FFF7E8;
  --text-dark: #333;
  --text-light: #666;
  --shadow: rgba(15, 91, 79, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--forest);
  margin-bottom: 1rem;
  font-weight: 600;
}

h1 {
  font-size: 3rem;
  line-height: 1.2;
}

h2 {
  font-size: 2.25rem;
  line-height: 1.3;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

/* Header and Navigation */
header {
  background: var(--cream);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(15, 91, 79, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--forest);
  font-weight: 700;
  font-size: 1.25rem;
}

.logo img {
  height: 80px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--trail-orange);
}

nav a.current {
  color: var(--forest);
  border-bottom: 2px solid var(--trail-orange);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn:focus {
  outline: 2px solid var(--trail-orange);
  outline-offset: 2px;
}

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

.btn-primary:hover {
  background-color: #E6692F;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 122, 61, 0.3);
}

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

.btn-secondary:hover {
  background-color: var(--forest);
  color: white;
}

/* Layout Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 4rem 0;
}

/* Cards */
.card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--shadow);
}

.card h3 {
  margin-bottom: 1rem;
}

.card p {
  margin-bottom: 0;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 6rem 0;
  background: linear-gradient(135deg, var(--cream) 0%, rgba(255, 247, 232, 0.8) 100%);
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 600px;
  margin: 0 auto 2.5rem auto;
}

.hero .btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Feature Cards */
.features {
  padding: 4rem 0;
}

.features h2 {
  text-align: center;
  margin-bottom: 3rem;
}

/* Testimonials */
.testimonials {
  background: rgba(15, 91, 79, 0.05);
  padding: 4rem 0;
}

.testimonial-card {
  text-align: center;
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px var(--shadow);
}

.testimonial-card p {
  font-style: italic;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.testimonial-card .author {
  font-weight: 600;
  color: var(--forest);
  font-size: 0.9rem;
}

/* Footer */
footer {
  background: var(--forest);
  color: var(--cream);
  padding: 2rem 0;
  text-align: center;
}

footer a {
  color: var(--trail-orange);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--forest);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--trail-orange);
}

/* Sliders */
.slider-group {
  margin-bottom: 1.5rem;
}

.slider-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--forest);
}

.slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--trail-orange);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--trail-orange);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px var(--shadow);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background: var(--forest);
  color: var(--cream);
  font-weight: 600;
}

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

/* Accordion */
.accordion {
  margin: 2rem 0;
}

.accordion-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.accordion-header {
  background: var(--forest);
  color: var(--cream);
  padding: 1rem;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header:hover {
  background: rgba(15, 91, 79, 0.9);
}

.accordion-content {
  padding: 1.5rem;
  display: none;
  background: white;
}

.accordion-content.active {
  display: block;
}

.accordion-toggle {
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.accordion-item.active .accordion-toggle {
  transform: rotate(180deg);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-content {
  background: var(--cream);
  padding: 2rem;
  border-radius: 12px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0.5rem;
  line-height: 1;
}

.modal-close:hover {
  color: var(--trail-orange);
}

/* Chart Container */
.chart-container {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
  margin: 2rem 0;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.kpi-card {
  background: var(--forest);
  color: var(--cream);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--trail-orange);
  display: block;
}

.kpi-label {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* Control Panel */
.control-panel {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px var(--shadow);
  margin-bottom: 2rem;
}

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

.button-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* SVG Diagrams */
.diagram {
  text-align: center;
  margin: 2rem 0;
}

.diagram svg {
  max-width: 100%;
  height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  nav ul {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h2 {
    font-size: 2rem;
  }
  
  .hero {
    padding: 4rem 0;
  }
  
  .hero .btn-group {
    flex-direction: column;
    align-items: center;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
  
  .grid-3 {
    grid-template-columns: 1fr;
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
  }
  
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .chart-container {
    padding: 1rem;
  }
  
  table {
    font-size: 0.9rem;
  }
  
  th, td {
    padding: 0.75rem 0.5rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1.1rem;
  }
  
  .card {
    padding: 1.5rem;
  }
  
  .control-panel {
    padding: 1.5rem;
  }
  
  .modal-content {
    margin: 1rem;
    padding: 1.5rem;
  }
}