/* General body styling */
body {
  background-color: #1a1a1a;
  color: #ffffff;
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
}

/* Container for forms (Register, Login, Create Key, Reset Password) */
.form-container {
  max-width: 400px;
  width: 100%;
  margin: 20px auto;
  padding: 20px;
  background-color: #222222;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.dashboard-container {
  display: flex;
  max-width: 1200px;
  margin: 50px auto;
  padding: 0; /* Remove padding here; handled by .content */
  background-color: #222222;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.small-font {
  font-size: 8;
}

/* Headings */
h1 {
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

h2 {
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: bold;
}

/* Form elements */
form p {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ffffff;
  border-radius: 5px;
  background-color: #2a2a2a;
  color: #ffffff;
  box-sizing: border-box;
}

input[type="submit"] {
  background-color: #007bff;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

input[type="submit"]:hover {
  background-color: #0056b3;
}

input[type="submit"][value="Delete"] {
  background-color: #dc3545;
}

input[type="submit"][value="Delete"]:hover {
  background-color: #c82333;
}

/* Links */
a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ffffff;
  margin-top: 20px;
}

th {
  background-color: #2a2a2a;
  color: #ffffff;
  padding: 10px;
  text-align: left;
}

td {
  padding: 10px;
  border-bottom: 1px solid #ffffff;
}

tr:nth-child(even) {
  background-color: #2a2a2a;
}

/* Flashed messages */
.success {
  background-color: #28a745;
  color: #ffffff;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
}

.error {
  background-color: #dc3545;
  color: #ffffff;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
}

.info {
  background-color: #3599dc;
  color: #ffffff;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 15px;
}

/* Navigation Links */
.nav-links {
  text-align: center;
  margin-bottom: 20px;
}

.nav-links a {
  color: #007bff;
  text-decoration: none;
  margin: 0 5px;
}

.nav-links a:hover {
  text-decoration: underline;
}

/* Summary */
.summary {
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
}

/* Search Form */
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-form label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-input {
  padding: 10px;
  border: 1px solid #ffffff;
  border-radius: 5px;
  background-color: #2a2a2a;
  color: #ffffff;
  flex: 1;
  min-width: 200px;
}

.select-field {
  padding: 10px;
  border: 1px solid #ffffff;
  border-radius: 5px;
  background-color: #2a2a2a;
  color: #ffffff;
  flex: 1;
  min-width: 150px;
}

.submit-btn {
  background-color: #007bff;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.submit-btn:hover {
  background-color: #0056b3;
}

/* Key Table */
.key-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ffffff;
  margin-top: 20px;
}

.key-table th {
  background-color: #2a2a2a;
  color: #ffffff;
  padding: 10px;
  text-align: left;
}

.key-table td {
  padding: 10px;
  border-bottom: 1px solid #ffffff;
}

.key-table tr:nth-child(even) {
  background-color: #2a2a2a;
}

/* Action Table (Now a Flex Container) */
.action-table {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Action Buttons */
.delete-btn {
  background-color: #dc3545;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.delete-btn:hover {
  background-color: #c82333;
}

.revoke-btn {
  background-color: #ffc107;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.revoke-btn:hover {
  background-color: #e0a800;
}

.activate-btn {
  background-color: #28a745;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.activate-btn:hover {
  background-color: #218838;
}

.permanent-btn {
  background-color: #17a2b8;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.permanent-btn:hover {
  background-color: #138496;
}

.update-btn {
  background-color: #007bff;
  color: #ffffff;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.update-btn:hover {
  background-color: #0056b3;
}

/* Adjust invocations input width for better usability */
.invocations-input {
  width: 70px;
  padding: 5px;
  border: 1px solid #ffffff;
  border-radius: 5px;
  background-color: #2a2a2a;
  color: #ffffff;
}

/* Form Styling */
.admin-form {
  width: 100%;
}

/* Flexbox for the update form to align input and button */
.update-form {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
}

/* Responsive Design */
@media (max-width: 600px) {
  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input,
  .select-field {
    width: 100%;
    min-width: unset;
  }

  .action-table {
    flex-direction: column;
    align-items: stretch;
  }

  .action-table form {
    width: 100%;
  }

  .update-form {
    flex-direction: column;
    width: 100%;
  }

  .invocations-input,
  .update-btn {
    width: 100%;
  }

  .form-container {
    margin: 10px auto;
    padding: 15px;
  }
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Preformatted text */
pre {
  background-color: #2a2a2a;
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
}

/* Table of Contents Styling */
.toc-container {
  background-color: #2a2a2a;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  margin-top: 20px;
}

.toc-list {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 15px;
}

.toc-list a {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
}

.toc-list a:hover {
  text-decoration: underline;
}

.toc-list p {
  margin: 5px 0 0 0;
  font-size: 14px;
  color: #cccccc;
}

/* Responsive Design for TOC */
@media (max-width: 600px) {
  .toc-container {
    padding: 15px;
  }

  .toc-list a {
    font-size: 16px;
  }

  .toc-list p {
    font-size: 12px;
  }
}

/* Sidebar navigation */
.sidebar {
  width: 200px;
  background-color: #1a1a1a;
  padding: 20px;
  box-sizing: border-box;
}

.sidebar h2 {
  margin-top: 0;
  font-size: 18px;
  margin-bottom: 15px;
  color: #ffffff;
}

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

.sidebar li {
  margin-bottom: 10px;
}

.sidebar a {
  color: #007bff;
  text-decoration: none;
}

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

/* Content area */
.content {
  flex: 1;
  padding: 20px;
}

/* Header for page heading and nav-links */
.header {
  text-align: center;
  margin-bottom: 20px;
}

.header h1 {
  margin-bottom: 10px;
}

.header .nav-links {
  margin-bottom: 20px;
}

.columns-wrapper {
  display: flex;
  gap: 20px;
}

.text-column,
.image-column {
  flex: 1;
}

.image-column img {
  max-height: 450px;
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .columns-wrapper {
    flex-direction: column;
  }
  .text-column,
  .image-column {
    flex: none;
    width: 100%;
  }
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
}

.video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Sidebar Toggle Button (hidden on desktop) */
.sidebar-toggle-btn {
  display: none;  /* Hidden by default */
  background-color: #007bff;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  font-weight: bold;
  width: auto;
  margin-bottom: 0px;  /* Base margin, but we'll increase on mobile */
}

/* Close Button (optional, for inside sidebar) */
.close-btn {
  display: none;  /* Hidden on desktop */
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  text-align: right;  /* Keep right alignment */
  margin-bottom: 10px;
  width: 100%;  /* Ensure full-width to push text to the right edge */
}

/* Mobile-Specific Styles */
@media (max-width: 768px) {
  .sidebar-toggle-btn,
  .close-btn {
    display: inline-block;  /* Inline-block for button; we'll override for close-btn */
  }

  .close-btn {
    display: block;  /* Block for close-btn to enable full-width right alignment */
  }

  .sidebar-toggle-btn {
    float: left;
    width: 20%;
    margin-left: 0;
    margin-bottom: 0px;  /* Increased bottom margin on mobile for space after button (like <br>) */
  }

  .dashboard-container {
    position: relative;
    flex-direction: column;
  }

  .sidebar {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #1a1a1a;
    overflow-y: auto;
    z-index: 5;
    padding: 20px;
    transition: transform 0.3s ease;
    transform: translateX(-100%);
  }

  .sidebar-toggle-checkbox:checked ~ .sidebar {
    display: block;
    transform: translateX(0);
  }

  .sidebar-toggle-checkbox:checked ~ .content::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4;
  }

  .content {
    position: relative;
    z-index: 1;
  }
}