/* FastASGI Tutorial Custom Styles - No Bootstrap */
html,
body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

/* Main Layout Container */
.container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left Sidebar Styles */
.sidebar {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 250px;
  min-width: 250px;
  padding: 20px;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  max-height: 100vh;
}

.sidebar h1 {
  margin: 0 0 30px 0;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.sidebar h2 {
  font-size: 16px;
  margin: 25px 0 10px 0;
  color: #e8f4fd;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

.sidebar li {
  margin: 8px 0;
}

.sidebar a {
  color: white;
  text-decoration: none;
  display: block;
  padding: 8px 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.sidebar a:hover,
.sidebar a.active {
  background: rgba(255, 255, 255, 0.1);
  border-left-color: #ffd700;
  transform: translateX(5px);
}

/* Main Content Area */
.content {
  flex: 1;
  padding: 20px 40px;
  overflow-y: auto;
  background-color: white;
  margin: 0 20px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Right Sidebar Styles */
.right-sidebar {
  background: #f8f9fa;
  width: 250px;
  min-width: 250px;
  padding: 20px;
  overflow-y: auto;
  border-left: 1px solid #dee2e6;
  position: sticky;
  top: 0;
  max-height: 100vh;
}

.right-sidebar h3 {
  color: #495057;
  font-size: 16px;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #dee2e6;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

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

.right-sidebar li {
  margin: 8px 0;
}

.right-sidebar a {
  color: #6c757d;
  text-decoration: none;
  display: block;
  padding: 6px 12px;
  border-radius: 5px;
  transition: all 0.2s ease;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.right-sidebar a:hover,
.right-sidebar a.active {
  background: #e9ecef;
  color: #495057;
  border-left-color: #667eea;
  transform: translateX(3px);
}

/* Content Styling */
.breadcrumb {
  background: #e9ecef;
  color: #6c757d;
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  font-size: 14px;
}

.breadcrumb a {
  color: #667eea;
  text-decoration: none;
}

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

.highlight {
  background: linear-gradient(135deg, #667eea15, #764ba215);
  border-left: 4px solid #667eea;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 5px;
}

/* Code Block Styles */
.code-block {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.code-block .lang-label {
  background: #667eea;
  color: white;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
}

.code-block pre {
  background: transparent;
  border: none;
  margin: 0;
  padding: 20px;
  overflow-x: auto;
}

.code-block code {
  background: transparent;
  color: #333;
  font-family: "Fira Code", "Monaco", "Consolas", monospace;
  line-height: 1.5;
}

/* Python Syntax Highlighting */
.python-keyword {
  color: #0000ff;
  font-weight: bold;
}

.python-string {
  color: #008000;
}

.python-comment {
  color: #808080;
  font-style: italic;
}

.python-number {
  color: #ff6600;
}

.python-builtin {
  color: #8b008b;
}

/* Card Styles */
.tutorial-card {
  border: 1px solid #dee2e6;
  border-radius: 10px;
  padding: 20px;
  margin: 20px 0;
  transition: all 0.3s ease;
  overflow: hidden;
  background: white;
}

.tutorial-card:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.tutorial-card .card-header {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 15px 20px;
  margin: -20px -20px 20px -20px;
  font-weight: 600;
  border-bottom: none;
}

.tutorial-card .card-body {
  background: #f8f9fa;
  padding: 15px 20px;
  margin: 20px -20px -20px -20px;
}

.tutorial-card a {
  color: inherit;
  text-decoration: none;
}

/* Alert Styles */
.alert-tip {
  background: #e8f5e8;
  border-left: 4px solid #28a745;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 5px;
  color: #155724;
}

.alert-warning {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 5px;
  color: #856404;
}

.alert-info {
  background: #d1ecf1;
  border-left: 4px solid #17a2b8;
  padding: 15px 20px;
  margin: 20px 0;
  border-radius: 5px;
  color: #0c5460;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #333;
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 600;
}

h1 {
  font-size: 2.5rem;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

h2 {
  font-size: 2rem;
  color: #495057;
}

h3 {
  font-size: 1.5rem;
  color: #495057;
}

p {
  margin-bottom: 15px;
  text-align: justify;
}

/* Flow Diagram Styles */
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 30px 0;
  padding: 25px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  border: 2px solid #dee2e6;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.flow-diagram h4 {
  width: 100%;
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 1.1rem;
  color: #495057;
  font-weight: 600;
}

.step-box {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  min-width: 140px;
  box-shadow: 0 3px 6px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.step-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(102, 126, 234, 0.4);
  border-color: rgba(255, 255, 255, 0.3);
}

.arrow {
  font-size: 1.5rem;
  color: #6c757d;
  font-weight: bold;
  margin: 0 5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Special styling for bidirectional arrows */
.arrow.bidirectional {
  color: #28a745;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* Flow diagram responsive design */
@media (max-width: 768px) {
  .flow-diagram {
    flex-direction: column;
    gap: 10px;
    padding: 20px 15px;
  }

  .step-box {
    min-width: 120px;
    font-size: 0.85rem;
    padding: 10px 16px;
  }

  .arrow {
    transform: rotate(90deg);
    font-size: 1.3rem;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .right-sidebar {
    display: none;
  }

  .content {
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: auto;
    position: sticky;
    top: 0;
    z-index: 100;
  }

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

  .sidebar h1 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  .sidebar h2 {
    font-size: 14px;
  }

  .sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .sidebar li {
    margin: 0;
  }

  .sidebar a {
    padding: 6px 12px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 15px 20px;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  .code-block pre {
    padding: 15px;
  }
}

/* Font size controls */
.font-size-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.font-btn {
  background: #2d3748;
  color: #e2e8f0;
  border: 1px solid #4a5568;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-btn:hover:not(:disabled) {
  background: #4a5568;
  border-color: #718096;
  transform: translateY(-1px);
}

.font-btn:active:not(:disabled) {
  transform: translateY(0);
}

.font-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #1a202c;
}

/* Dark mode adjustments for font controls */
@media (prefers-color-scheme: dark) {
  .font-size-controls {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .font-btn {
    background: #1a1a1a;
    color: #f0f0f0;
    border-color: #333;
  }

  .font-btn:hover:not(:disabled) {
    background: #333;
    border-color: #555;
  }

  .font-btn:disabled {
    background: #0a0a0a;
  }
}

/* Table Styles */
.spec-table,
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spec-table th,
table th {
  background: #4a5568;
  color: white;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  border: 1px solid #2d3748;
}

.spec-table td,
table td {
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  vertical-align: top;
}

.spec-table tr:nth-child(even),
table tr:nth-child(even) {
  background: #f8f9fa;
}

.spec-table tr:hover,
table tr:hover {
  background: #e8f4fd;
}

/* Dark mode table styles */
@media (prefers-color-scheme: dark) {
  .spec-table,
  table {
    background: #2d3748;
    color: #e2e8f0;
  }

  .spec-table th,
  table th {
    background: #1a202c;
    color: #f7fafc;
    border-color: #4a5568;
  }

  .spec-table td,
  table td {
    border-color: #4a5568;
  }

  .spec-table tr:nth-child(even),
  table tr:nth-child(even) {
    background: #374151;
  }

  .spec-table tr:hover,
  table tr:hover {
    background: #4a5568;
  }
}
