/* Main Styling for Data Structures using C++ Website */
:root {
  --primary-color: #FF9F45; /* Light Orange */
  --secondary-color: #87CEEB; /* Light Blue */
  --accent-color: #e74c3c;
  --light-bg: #f5f5f5;
  --dark-bg: #87CEEB; /* Light Blue */
  --text-color: #000; /* Black */
  --light-text: #fff; /* White */
  --code-bg: #f0f0f0;
  --border-color: #ddd;
  --success-color: #2ecc71;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
  padding-top: 70px; /* For fixed navbar */
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header Styles */
header {
  background-color: var(--primary-color); /* Light Orange */
  color: var(--light-text);
  padding: 15px 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

.logo a {
  color: var(--light-text);
  text-decoration: none;
}

/* Navigation Styles */
nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 20px;
}

nav ul li a {
  color: var(--light-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

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

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--primary-color); /* Light Orange */
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
}

.dropdown-content a {
  color: var(--light-text);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  transition: background-color 0.3s;
}

.dropdown-content a:hover {
  background-color: #FFC288; /* Lighter Orange */
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Main Content Styles */
main {
  min-height: calc(100vh - 180px);
}

.hero {
  background-color: var(--primary-color); /* Light Orange */
  color: var(--light-text); /* White */
  padding: 60px 0;
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}

.section {
  margin-bottom: 40px;
  background-color: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section-title {
  color: var(--secondary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
}

.subsection {
  margin-bottom: 30px;
}

.subsection-title {
  color: var(--secondary-color);
  margin-bottom: 15px;
  font-size: 1.4rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
}

p {
  margin-bottom: 15px;
}

ul, ol {
  margin-bottom: 15px;
  padding-left: 20px;
}

li {
  margin-bottom: 5px;
}

/* Code Blocks */
pre {
  background-color: var(--code-bg);
  padding: 15px;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
}

code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
}

.inline-code {
  background-color: var(--code-bg);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

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

th {
  background-color: var(--secondary-color);
  color: var(--light-text);
}

tr:nth-child(even) {
  background-color: var(--light-bg);
}

/* Cards */
.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-header {
  background-color: var(--primary-color);
  color: var(--light-text);
  padding: 15px;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 15px;
  background-color: var(--light-bg);
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--light-text);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #2980b9;
}

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

.btn-secondary:hover {
  background-color: #1a252f;
}

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

.btn-accent:hover {
  background-color: #c0392b;
}

/* Footer */
footer {
  background-color: var(--secondary-color); /* Light Blue */
  color: var(--text-color); /* Black */
  padding: 30px 0;
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-section {
  flex: 1;
  min-width: 300px;
  margin-bottom: 20px;
}

.footer-section h3 {
  margin-bottom: 15px;
  color: var(--primary-color);
}

.footer-bottom {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #34495e;
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

/* Responsive Design */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
  }
  
  nav ul {
    margin-top: 15px;
  }
  
  nav ul li {
    margin-left: 10px;
    margin-right: 10px;
  }
  
  .hero {
    padding: 40px 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .section {
    padding: 20px;
  }
  
  .card-container {
    grid-template-columns: 1fr;
  }
}

/* Diagrams and Visualizations */
.diagram {
  max-width: 100%;
  margin: 20px auto;
  display: block;
}

.visualization {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background-color: white;
}

/* Algorithm Steps */
.algorithm-steps {
  background-color: #f8f9fa;
  border-left: 4px solid var(--primary-color);
  padding: 15px;
  margin-bottom: 20px;
}

.algorithm-steps ol {
  margin-bottom: 0;
}

/* Notes and Warnings */
.note {
  background-color: #d4edda;
  border-left: 4px solid var(--success-color);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.warning {
  background-color: #f8d7da;
  border-left: 4px solid var(--accent-color);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 4px;
}

/* Search Bar */
.search-container {
  margin-bottom: 30px;
}

.search-bar {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.search-bar:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* Breadcrumbs */
.breadcrumbs {
  margin-bottom: 20px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumbs a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span {
  margin: 0 5px;
  color: #777;
}

/* Print Styles */
@media print {
  body {
    padding-top: 0;
  }
  
  header, footer, .no-print {
    display: none;
  }
  
  .container {
    width: 100%;
    max-width: none;
    padding: 0;
  }
  
  .section {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
  
  a {
    color: var(--text-color);
    text-decoration: none;
  }
  
  pre, code {
    white-space: pre-wrap;
  }
}