body {
  background-color: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding-top: 60px; /* Space for fixed navbar */
  text-align: center;
}

body.has-navbar {
  padding-top: 60px; /* Space for fixed navbar when user is authenticated */
}

.container {
  max-width: 900px;
  width: 90%;
  margin: 0 auto;
  padding: 2rem 0;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

h2 {
  text-align: left;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
  margin-top: 3rem;
}

h3 {
  text-align: left;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}

p {
  color: #888;
}

a {
  color: #0070f3;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
  text-align: left;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

label {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.5rem;
}

input[type='text'],
input[type='password'],
input[type='number'],
input[type='file'],
textarea,
.themed-select {
  background-color: #1c1c1c;
  border: 1px solid #333;
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  -webkit-appearance: none; /* Remove default browser styling for select */
  -moz-appearance: none;
  appearance: none;
}

.themed-select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ffffff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13.2-5.4H18.6c-5%200-9.3%201.8-13.2%205.4A17.6%2017.6%200%200%200%200%2082.2c0%204.6%201.8%208.9%205.4%2012.9l128%20127.9c3.9%203.9%208.2%205.4%2012.9%205.4s9.1-1.5%2012.9-5.4L287%2095c3.9-3.9%205.4-8.2%205.4-12.9%200-4.6-1.5-8.9-5.4-12.9z%22%2F%3E%3C%2Fsvg%3E"); /* Custom arrow */
  background-repeat: no-repeat;
  background-position: right 0.7em top 50%;
  background-size: 0.65em auto;
}

input[type='text']:focus,
input[type='password']:focus,
input[type='number']:focus,
input[type='file']:focus,
textarea:focus,
.themed-select:focus {
  outline: none;
  border-color: #0070f3;
}

button {
  background-color: #0070f3;
  color: #fff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
  margin-top: 1rem;
  align-self: flex-start;
  font-family: inherit;
}

button:hover {
  background-color: #005bb5;
  opacity: 0.9;
}

.secondary-button {
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
}

.secondary-button:hover {
  background-color: #555;
}

p.error {
  color: #ff4d4d;
  margin-top: 1rem;
  margin-bottom: 0;
}

.logout-button {
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
  margin-top: 0; /* Adjusted for navbar */
  align-self: center; /* Adjusted for navbar */
}

.logout-button:hover {
  background-color: #555;
}

/* Navbar Styles */
.navbar {
  background-color: #1c1c1c;
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 1000;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.navbar-brand img {
  height: 32px;
  width: 32px;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-links a {
  color: #888;
  font-weight: 500;
  transition: color 0.2s ease;
}

.navbar-links a:hover,
.navbar-links a.active {
  color: #fff;
}

/* File Browser Styles */
.file-browser {
  margin-top: 1.5rem;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.file-table thead {
  border-bottom: 1px solid #333;
}

.file-table th {
  padding: 0.75rem 1rem;
  color: #888;
  font-weight: 500;
}

.file-table tbody tr {
  border-bottom: 1px solid #222;
}

.file-table tbody tr:hover {
  background-color: #111;
}

.file-table td {
  padding: 1rem;
  vertical-align: middle;
}

.file-table .icon-cell {
  width: 40px;
  text-align: center;
  font-size: 1.2rem;
  color: #888;
}

.file-table .actions-cell {
  width: 120px;
  text-align: right;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.action-btn {
  color: #888;
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.2s ease;
  padding: 0.25rem;
  border-radius: 4px;
  background-color: transparent; /* Ensure action buttons are transparent */
  border: none; /* Ensure action buttons have no border */
}

.action-btn:hover {
  color: #fff;
  background-color: #333;
}

.action-btn.delete:hover {
  color: #ff4d4d;
  background-color: #333;
}

.empty-cell {
  text-align: center;
  padding: 2rem;
  color: #555;
}

/* Terminal Styles */
#terminal-container {
  width: 100%;
  height: 400px;
  margin-top: 1rem;
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  text-align: left; /* Left-align terminal text */
}

#terminal {
    height: 100%;
}

/* CodeMirror Dark Theme */
.CodeMirror {
  border: 1px solid #333;
  height: 500px;
  font-size: 1rem;
  background-color: #1c1c1c;
  color: #fff;
  border-radius: 8px;
  text-align: left; /* Ensure CodeMirror text is left-aligned */
}

.CodeMirror-gutters {
  background-color: #1c1c1c;
  border-right: 1px solid #333;
}

.CodeMirror-linenumber {
  color: #888;
}

.CodeMirror-cursor {
  border-left: 1px solid #fff;
}

.CodeMirror-selected {
  background-color: #0070f3 !important;
}

.cm-s-default .cm-comment { color: #555; }
.cm-s-default .cm-keyword { color: #0070f3; }
.cm-s-default .cm-string { color: #98c379; }
.cm-s-default .cm-number { color: #d19a66; }
.cm-s-default .cm-variable { color: #e06c75; }
.cm-s-default .cm-property { color: #c678dd; }
.cm-s-default .cm-def { color: #e6c07b; }
.cm-s-default .cm-operator { color: #56b6c2; }
.cm-s-default .cm-meta { color: #abb2bf; }
.cm-s-default .cm-atom { color: #e06c75; }
.cm-s-default .cm-builtin { color: #e6c07b; }
.cm-s-default .cm-tag { color: #e06c75; }
.cm-s-default .cm-attribute { color: #d19a66; }
.cm-s-default .cm-type { color: #e6c07b; }
.cm-s-default .cm-qualifier { color: #e06c75; }
.cm-s-default .cm-error { color: #ff4d4d; }

/* Password List Specific Styles */
.password-list .actions-cell button.action-btn {
  background-color: transparent; /* Ensure these specific action buttons are transparent */
  color: #888; /* Reset color */
}

.password-list .actions-cell button.action-btn:hover {
  background-color: #333; /* Apply hover background */
  color: #fff; /* Apply hover color */
}

.password-list .actions-cell button.action-btn.delete:hover {
  color: #ff4d4d;
}

.password-display {
  margin-right: 0.5rem;
}

.username-display {
  margin-right: 0.5rem;
}

.copy-button {
  background-color: transparent;
  border: none;
  color: #0070f3;
  padding: 0.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease;
  margin-left: 0.5rem;
}

.copy-button:hover {
  color: #fff;
}

.copy-button i {
  pointer-events: none; /* Prevent icon from interfering with click event */
}

/* SSH Auth Method Select */
.auth-method-select {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  justify-content: flex-start;
}

.auth-method-select .radio-option {
  display: flex;
  align-items: center;
  background-color: #1c1c1c;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; /* Add color to transition */
  color: #fff; /* Default text color for radio option */
}

.auth-method-select .radio-option:hover {
  background-color: #2a2a2a;
  border-color: #FFA500; /* Orange hover */
}

.auth-method-select input[type='radio'] {
  /* Hide the actual radio button */
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.auth-method-select .radio-option.selected {
  background-color: #FFA500; /* Orange selected background color */
  border-color: #FFA500;
}

.auth-method-select .radio-option.selected label {
  color: #000 !important; /* Force black text for selected orange background */
  font-weight: 600; /* Ensure bold text */
}

.connection-options {
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid #333;
  border-radius: 8px;
  background-color: #1c1c1c;
}

.connection-options .form-group {
  margin-bottom: 0.75rem;
}

.connection-options .form-group:last-of-type {
  margin-bottom: 0;
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-start;
}

.button-group .button {
  margin-top: 0;
}

/* Tool Section for Account Page */
.tool-section {
  margin-top: 2rem;
  border: 1px solid #333;
  border-radius: 8px;
  background-color: #1c1c1c;
  padding: 1rem;
  text-align: left;
  max-width: 600px; /* Limit width */
  margin-left: auto;
  margin-right: auto;
}

.tool-section summary {
  cursor: pointer;
  outline: none;
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  padding: 0.5rem 0;
  list-style: none; /* Hide default triangle */
  display: flex;
  align-items: center;
}

.tool-section summary::-webkit-details-marker {
  display: none;
}

.tool-section summary::before {
  content: '\25B6'; /* Right-pointing triangle */
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
}

.tool-section[open] summary::before {
  content: '\25BC'; /* Down-pointing triangle */
  transform: rotate(90deg); /* Rotate for better visual */
}

.tool-section .tool-content {
  padding-top: 1rem;
  border-top: 1px solid #2a2a2a;
  margin-top: 1rem;
}

.tool-section h3 {
  margin-top: 0;
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
  display: inline;
}

.tool-section h4 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

/* Specific styles for password list action buttons */
.password-list .actions-cell button.action-btn {
  background-color: transparent; /* Ensure these specific action buttons are transparent */
  color: #888; /* Reset color */
}

.password-list .actions-cell button.action-btn:hover {
  background-color: #333; /* Apply hover background */
  color: #fff; /* Apply hover color */
}

.password-list .actions-cell button.action-btn.delete:hover {
  color: #ff4d4d;
}

.password-display {
  margin-right: 0.5rem;
}

.username-display {
  margin-right: 0.5rem;
}

.copy-button {
  background-color: transparent;
  border: none;
  color: #0070f3;
  padding: 0.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease;
  margin-left: 0.5rem;
}

.copy-button:hover {
  color: #fff;
}

.copy-button i {
  pointer-events: none; /* Prevent icon from interfering with click event */
}
