/* Base styles */
body {
    font-family: 'Roboto', 'Segoe UI', 'Tahoma', 'sans-serif';
    line-height: 1.6;
    font-size: 18px;
    color: #333;
    background: #fafafa;
    margin: 0;
    padding: 0 5%;
    max-width: 1200px; /* centralise content */
    margin-left: auto;
    margin-right: auto;
}

/* Make all images responsive */
img {
    max-width: 100%; /* Prevent overflow */
    height: auto; /* Maintain aspect ratio */
    display: block;
    margin: 20px auto; /* Center images */
    border-radius: 8px; /* Smooth edges */
}

/* Dropdown Menu */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #69d8ec;
  min-width: 180px;
  padding: 10px 0px;
  top: 100%;
  left: 0;
  border-radius: 5px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
  right: auto;
  overflow-wrap: break-word;
  white-space: nowrap;
  z-index: 1000;
}

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

.dropdown-content li a {
  padding: 10px;
  display: block;
}

.dropbtn {
  cursor: pointer;
  display: inline-block;
}

.dropdown-content li a:hover {
  background: #ffffff;
}

/* Navbar */
nav {
    background: #007bff;
    color: white;
    padding: 10px 20px; /* Smaller padding to keep navbar compact */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: relative;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    overflow: visible;
}

nav h1, nav a {
    font-size: clamp(16px, 2vw, 22px); /* Responsive font size */
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    padding: 0;
    margin: 0;
}

nav a {
    color: white;
    text-decoration: none;
}

/* Table Styles */
table, th, td {
  border: 1px solid rgb(0, 0, 0);
  border-collapse: collapse;
  width: 100%;
}

th, td {
  padding: 8px;
  text-align: left;
}

/* Buttons */
.run-button {
  background: linear-gradient(135deg, #007bff, #3fb7ea);
  background-size: 200% 200%;
  color: #fff;
  font-weight: bold;
  padding: 12px 25px;
  border: black;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  transition: all 0.4s ease;
  width: fit-content; /* Only as wide as the text */
  max-width: 300px;
  margin: 10px 0; /* Removed auto centering */
  display: inline-block; /* So it aligns left naturally */
}

.run-button:hover {
  background-position: right center;
}

.run-button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

/* Textarea */
.auto-expand, textarea {
  width: 80%;
  max-width: fit-content;
  padding: 10px;
  font-family: 'Fira Code', monospace;
  font-size: 16px;
  line-height: 1.5;
  border-radius: 10px;
  background: #007bff;
  color: #f8f8f2;
  overflow-y: auto;
  resize: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  border: none;
  min-height: 200px;
}

textarea:focus {
  box-shadow: 0 0 10px #00ffcc;
}

@media (max-width: 992px) {
    body { padding: 0 4%; }
    nav ul { gap: 0.8em; }
}

@media (max-width: 768px) {
    body { padding: 0 3%; font-size: 16px; }
    nav { flex-direction: column; text-align: center; gap: 10px; }
    nav ul { flex-direction: column; gap: 0.5em; }
    .dropdown-content { position: static; box-shadow: none; min-width: 100%; border-radius: 0; }
    table, th, td { font-size: 14px; }
    .run-button { width: 100%; font-size: 14px; }
}

@media (max-width: 480px) {
    body { padding: 0 2%; font-size: 15px; }
    nav h1 { font-size: 18px; }
    nav ul { gap: 0.3em; }
    pre, textarea { font-size: 14px; }
}
/* Syntax box */
.syntax-box {
  background: #2b2b2b;
  color: #f8f8f2;
  padding: 14px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
}

/* Notes */
.note-box {
  background: #e6f7ff;
  border-left: 6px solid #1890ff;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: Arial, sans-serif;
  font-size: 15px;
  font-style: italic;
  line-height: 1.5;
  color: #333;
  max-width: 100%;
  margin: 40px auto;
}

/* Code blocks */
pre {
  background: #007bff;
  color: #f8f8f2;
  padding: 16px;
  max-width: fit-content;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 1em 0;
  font-family: 'Fira Code', 'Consolas', monospace;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

code {
  background: #414141;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 15px;
  font-family: 'Fira Code', 'Consolas', monospace;
}

/* Reusable buttons */
.btn {
    display: inline-block;
    padding: 0.8em 1.5em;
    margin: 10px 0;
    background: #007bff;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.3s ease;
    width: fit-content;
    text-align: center;
}

.btn:hover {
    background: #3fb7ea;
}

/* Header */
header {
    text-align: center;
    padding: 2em 1em;
    max-width: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        text-align: center;
        padding: 10px;
    }
    nav ul {
        flex-direction: column;
        gap: 0.5em;
    }
    .dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background: #333;
  min-width: 200px;
  top: 100%;
  left: 0;
  border-radius: 5px;
  box-shadow: 0px 4px 8px rgba(0,0,0,0.2);
  white-space: nowrap;
  z-index: 1000;
}

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

.dropdown-content li a {
  padding: 10px;
  display: block;
  color: white;
}

.dropdown-content li a:hover {
  background: #555;
}
    table, th, td {
        font-size: 14px;
    }
    body {
        font-size: 16px;
        padding: 0 3%;
    }
    .run-button {
        font-size: 16px;
    }
}
