/* FTDX-10 Arduino Controller Website Styles */

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --bg-color: #ecf0f1;
  --text-color: #2c3e50;
  --light-bg: #ffffff;
  --code-bg: #282c34;
  --code-text: #abb2bf;
  --border-color: #bdc3c7;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 2rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

header p {
  font-size: 1rem;
  opacity: 0.9;
}

/* Navigation */
nav {
  background-color: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 999;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

nav li {
  margin: 0;
}

nav a {
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

nav a:hover,
nav a.active {
  background-color: var(--bg-color);
  border-bottom-color: var(--secondary-color);
  color: var(--secondary-color);
}

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

/* Content Area */
.content {
  background-color: var(--light-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--secondary-color);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn:hover {
  background-color: #2980b9;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

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

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

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

.btn-outline {
  background-color: transparent;
  border-color: white;
  color: white;
}

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

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

.card {
  background-color: var(--light-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  border-left: 4px solid var(--secondary-color);
}

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

.card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.card p {
  margin-bottom: 1rem;
  color: #555;
}

.card ul {
  margin-left: 1.5rem;
  color: #555;
}

.card ul li {
  margin-bottom: 0.5rem;
}

/* Features List */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.feature-icon {
  font-size: 2rem;
  color: var(--secondary-color);
  min-width: 50px;
}

.feature-content h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* Code Blocks */
pre {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 1.5rem;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: var(--shadow);
}

code {
  background-color: var(--code-bg);
  color: var(--code-text);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

pre code {
  background-color: transparent;
  padding: 0;
}

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

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

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background-color: var(--bg-color);
}

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

/* Alert Boxes */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 5px;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.alert-info {
  background-color: #d1ecf1;
  border-color: #0c5460;
  color: #0c5460;
}

.alert-warning {
  background-color: #fff3cd;
  border-color: #856404;
  color: #856404;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #721c24;
  color: #721c24;
}

.alert-success {
  background-color: #d4edda;
  border-color: #155724;
  color: #155724;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

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

p {
  margin-bottom: 1rem;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Sidebar */
.layout-sidebar {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  align-items: start;
}

.sidebar {
  background-color: var(--light-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 140px;
}

.sidebar h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: var(--primary-color);
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.5rem;
}

.sidebar ul {
  list-style: none;
  margin-left: 0;
}

.sidebar li {
  margin-bottom: 0.75rem;
}

.sidebar a {
  display: block;
  padding: 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  color: var(--text-color);
}

.sidebar a:hover,
.sidebar a.active {
  background-color: var(--bg-color);
  color: var(--secondary-color);
  text-decoration: none;
  padding-left: 1rem;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--secondary-color);
}

footer a:hover {
  color: white;
}

/* Checklist */
.checklist {
  list-style: none;
  margin-left: 0;
}

.checklist li {
  padding-left: 2rem;
  position: relative;
  margin-bottom: 0.75rem;
}

.checklist li:before {
  content: "☐";
  position: absolute;
  left: 0;
  font-size: 1.25rem;
  color: var(--secondary-color);
}

/* Download Section */
.download-box {
  background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.download-box h3 {
  color: white;
  margin-top: 0;
}

/* Code Viewer */
.code-viewer {
  background-color: var(--code-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 2rem 0;
}

.code-header {
  background-color: #21252b;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #181a1f;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.code-filename {
  color: var(--code-text);
  font-family: 'Courier New', Courier, monospace;
  font-weight: 600;
}

.code-content {
  padding: 0;
  max-height: 600px;
  overflow-y: auto;
}

.code-content pre {
  margin: 0;
  border-radius: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    padding: 0 1rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  nav ul {
    flex-direction: column;
  }

  nav a {
    border-left: 3px solid transparent;
    border-bottom: none;
  }

  nav a:hover,
  nav a.active {
    border-left-color: var(--secondary-color);
    border-bottom-color: transparent;
  }

  .container {
    padding: 0 1rem;
  }

  .content {
    padding: 1.5rem;
  }

  .hero h2 {
    font-size: 1.75rem;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .layout-sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

/* Print Styles */
@media print {
  header, nav, footer, .sidebar, .hero-buttons {
    display: none;
  }

  .content {
    box-shadow: none;
    padding: 0;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  pre {
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.hidden { display: none; }
