:root {
  --primary-color: #3776ab;
  --secondary-color: #ffd43b;
  --text-color: #333;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --footer-bg: #333;
  --footer-text: #fff;
  --border-color: #dee2e6;
  --editor-bg: #272822;
  --output-bg: #f8f9fa;
  --output-text: #333;
}

.dark-theme {
  --primary-color: #306998;
  --secondary-color: #ffd43b;
  --text-color: #f8f9fa;
  --bg-color: #1a1a1a;
  --card-bg: #2d2d2d;
  --footer-bg: #111;
  --footer-text: #ddd;
  --border-color: #444;
  --editor-bg: #1a1a1a;
  --output-bg: #2d2d2d;
  --output-text: #f8f9fa;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s, color 0.3s;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

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

/* Header */
header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
}

.logo i {
  margin-right: 10px;
  color: var(--secondary-color);
}

.nav-links {
  display: flex;
  list-style: none;
}

.nav-links li {
  margin-left: 1.5rem;
}

.nav-links a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--secondary-color);
}

.theme-toggle {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
}

/* Hero Section */
.hero {
  
  text-align: center;
  background: linear-gradient(to right, var(--primary-color), #5a9fd4);
  color: white;
}

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

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

/* Main Content */
main {
  padding: 2rem 0;
}

.compiler-section {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
/* Flex-wrapper */
.content-wrapper {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  align-items: flex-start;
}
}

.sidebar-panel {
  display: none; /* По умолчанию скрыта */
  width: 100%;
  max-width: 300px;
  min-height: 300px;
}

.sidebar-panel.has-content {
  display: block;
}

/* Адаптивность */
@media (min-width: 768px) {
  .content-wrapper {
    flex-direction: row;
  }
  
  .sidebar-panel.has-content {
    display: block;
  }
}

@media (max-width: 767px) {
  .content-wrapper {
    flex-direction: column;
  }

  .sidebar-panel {
    width: 100%;
    max-width: none;
  }
}

.compiler-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

/* Ace Editor Styles */
.editor-container {
  display: flex;
  flex-direction: column;
  height: 560px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.code-editor-container {
  display: flex;
  flex: 1;
  height: 100%;
}

#editor {
  width: 100%;
  height: 100%;
  font-size: 14px;
}

.output-container {
  height: 150px;
  background-color: var(--output-bg);
  color: var(--output-text);
  border-top: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 10px;
  font-family: monospace;
  white-space: pre-wrap;
}

.editor-controls {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}

.control-left {
  display: flex;
  gap: 10px;
}

.control-right {
  display: flex;
  gap: 10px;
}

.btn-run {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-run:hover {
  background-color: #2c5d8f;
}

.btn-clear {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-clear:hover {
  background-color: #5a6268;
}

.btn-settings {
  background: none;
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-color);
}

.btn-settings:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.btn-action {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  margin:5px;
}

.btn-action:hover {
  background-color: #2c5d8f;
}

.font-size-control {
  display: flex;
  align-items: center;
  gap: 5px;
}

.font-size-control select {
  padding: 5px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-color);
}

.gutter {
  background-color: var(--border-color);
  background-repeat: no-repeat;
  background-position: 50%;
}

.gutter.gutter-horizontal {
  cursor: col-resize;
}

.gutter.gutter-vertical {
  cursor: row-resize;
}

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

.feature-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.feature-card i {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

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

/* Common Styles for Both Sections */
.examples-section, .errors-section {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.examples-section h2, .errors-section h2 {
  margin-bottom: 1rem;
  text-align: center;
}

.examples-tabs, .errors-tabs {
  display: inline-block;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.tab-btn {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-color);
  opacity: 0.7;
}

.tab-btn.active {
  border-bottom: 2px solid var(--primary-color);
  opacity: 1;
}

.example-code, .error-code {
  background-color: var(--bg-color);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.example-code pre, .error-code pre {
  white-space: pre-wrap;
}

/* Specific Styles for Errors Section */
.error-example {
  margin-bottom: 2rem;
}

.error-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.error-header h3 {
  margin: 0;
}

.run-example-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.run-example-btn:hover {
  background-color: var(--primary-color-dark);
}

.error-description {
  margin-bottom: 1rem;
}

.error-blocks {
  
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .error-blocks {
    grid-template-columns: 1fr;
  }
}

.error-code, .error-solution {
  background-color: var(--bg-color);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
}

.error-code h4, .error-solution h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.error-tips {
  background-color: var(--light-bg);
  padding: 1rem;
  border-radius: 4px;
  border-left: 4px solid var(--primary-color);
}

.error-tips h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.error-tips ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}


/* FAQ Section */
.faq-section {
  margin: 2rem 0;
}
.faq-section ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.faq-section h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.faq-item {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-question {
  font-weight: bold;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}

.faq-answer {
  margin-top: 1rem;
  display: none;
}

.faq-answer.show {
  display: block;
}

/* Call to Action */
.cta-section {
  background-color: var(--primary-color);
  color: white;
  text-align: center;
  padding: 3rem 0;
  margin: 2rem 0;
  border-radius: 8px;
}

.cta-section .h2 {
  margin-bottom: 1rem;
  font-size: 1.5em;
  font-weight: bold;
}

.cta-section p {
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  display: inline-block;
  background-color: var(--secondary-color);
  color: #333;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s;
}

.btn:hover {
  background-color: #ffe873;
}

/* Footer */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 2rem 0;
}

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

.footer-section h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--footer-text);
  text-decoration: none;
}

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

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  color: var(--footer-text);
  font-size: 1.5rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
  }
  
  .nav-links.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    padding: 1rem;
    z-index: 1000;
  }
  
  .nav-links.show li {
    margin: 0.5rem 0;
  }
  
  .editor-controls {
    flex-direction: column;
    gap: 10px;
  }
  
  .control-right {
    justify-content: flex-end;
  }
}

@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Добавленные стили для поддержки функциональности Ace Editor */
#load-example-btn {
  background-color: var(--secondary-color);
  color: #333;
  border: none;
  padding: 5px 15px;
  border-radius: 4px;
  cursor: pointer;
}

#load-example-btn:hover {
  background-color: #ffe873;
}

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

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--card-bg);
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
}

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

.dropdown-content a:hover {
  background-color: rgba(0,0,0,0.1);
}

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

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.example-header {
  display: flex;
  justify-content: flex-end;
  padding: 5px;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.run-example-btn {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.run-example-btn:hover {
  background-color: #45a049;
}