:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #2980b9;
  --light-color: #ecf0f1;
  --dark-color: #1a252f;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --sidebar-width: 300px;
  --header-height: 150px;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
  color: white;
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: auto;
}

.header h1 {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 15px;
}

.version-badge {
  background-color: var(--secondary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: normal;
  vertical-align: middle;
  margin-left: 10px;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: white;
  box-shadow: var(--box-shadow);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 1.5rem 0;
  z-index: 90;
  transition: transform var(--transition-speed);
}

.sidebar-header {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 1rem;
}

.sidebar-header h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-header h3 i {
  color: var(--secondary-color);
}

.menu {
  list-style: none;
}

.menu-item {
  margin-bottom: 5px;
}

.menu-link {
  display: flex;
  align-items: center;
  padding: 12px 1.5rem;
  color: #555;
  text-decoration: none;
  transition: all 0.2s;
  border-left: 4px solid transparent;
}

.menu-link:hover {
  background-color: #f1f8ff;
  color: var(--secondary-color);
  border-left-color: var(--secondary-color);
}

.menu-link.active {
  background-color: #e8f4fc;
  color: var(--secondary-color);
  border-left-color: var(--secondary-color);
  font-weight: 600;
}

.menu-link i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 2rem;
  transition: margin-left var(--transition-speed);
}

.section {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--light-color);
}

.section-header h2 {
  color: var(--primary-color);
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-header h2 i {
  color: var(--secondary-color);
}

.section-subtitle {
  color: #666;
  font-size: 1.1rem;
  margin-top: 5px;
}

.class-info {
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.class-description {
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.property-list,
.method-list {
  margin-bottom: 1.5rem;
}

.property-list h4,
.method-list h4 {
  color: var(--primary-color);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.property-list ul,
.method-list ul {
  list-style: none;
  padding-left: 20px;
}

.property-list li,
.method-list li {
  margin-bottom: 8px;
  padding-left: 5px;
  position: relative;
}

.property-list li:before,
.method-list li:before {
  content: "•";
  color: var(--secondary-color);
  font-weight: bold;
  position: absolute;
  left: -15px;
}

/* Mejorado: Estilos para bloques de código */
.code-example-container {
  background-color: #1e1e1e;
  border-radius: var(--border-radius);
  margin: 1.5rem 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.code-header {
  background-color: #2d2d2d;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3e3e3e;
}

.code-title {
  color: #ccc;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-btn {
  background-color: #3e3e3e;
  color: #ccc;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background-color: var(--secondary-color);
  color: white;
}

.code-block {
  padding: 20px;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #d4d4d4;
  background-color: #1e1e1e;
  max-height: 400px;
  overflow-y: auto;
}

/* Resaltado de sintaxis PHP */
.php-keyword {
  color: #569cd6;
}

.php-function {
  color: #dcdcaa;
}

.php-class {
  color: #4ec9b0;
}

.php-variable {
  color: #9cdcfe;
}

.php-string {
  color: #ce9178;
}

.php-comment {
  color: #6a9955;
  font-style: italic;
}

.php-number {
  color: #b5cea8;
}

.php-operator {
  color: #d4d4d4;
}

.php-html {
  color: #808080;
}

.example-panel {
  background-color: #fff3cd;
  border-left: 6px solid #ffc107;
  padding: 1.5rem;
  border-radius: 4px;
  margin: 1.5rem 0;
}

.example-panel h4 {
  color: #856404;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 8px;
}

.badge-primary {
  background-color: var(--primary-color);
  color: white;
}

.badge-success {
  background-color: var(--success-color);
  color: white;
}

.badge-warning {
  background-color: var(--warning-color);
  color: white;
}

.hierarchy {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #666;
  flex-wrap: wrap;
}

.hierarchy i {
  margin: 0 8px;
  color: #aaa;
}

/* Demo interactivo */
.demo-container {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #dee2e6;
}

.demo-header h4 {
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.demo-result {
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1.5rem;
  min-height: 100px;
  margin-top: 1rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.5rem;
  color: #666;
  font-size: 0.9rem;
  border-top: 1px solid #eee;
  margin-top: 2rem;
  background-color: #f8f9fa; /* Fondo para mayor visibilidad */
}

/* Toggle button for mobile */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.4rem;
  }

  .main-content {
    padding: 1rem;
  }

  .section {
    padding: 1.5rem;
  }
}

/* Scroll spy indicator */
.scroll-spy-indicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--secondary-color);
  color: white;
  padding: 10px 15px;
  border-radius: 50px;
  font-size: 0.9rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 80;
}

/* Utility classes */
.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}