:root {
  --font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --text-color: #1f2937; /* gray-800 */
  --bg-color: #ffffff;
  --accent-color: #2563eb; /* blue-600 */
  --accent-color-hover: #1d4ed8; /* blue-700 */
  --error-color: hsla(0, 100%, 50%, 0.603); /* red-600 */
  --border-color: #e5e7eb; /* gray-200 */
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--text-color);
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* H1*/
h1 {
  font-family: var(--font-family);
  font-weight: 700;
  color: var(--accent-color);
  font-size: 4rem;
}
/* Links */
a {
  color: var(--accent-color);
  text-decoration: none;
}
a:hover,
a:focus-visible {
  text-decoration: none;
}

/* Utility button class (and generic button element) */
.button,
button,
input[type="submit"] {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
}
.button:hover,
button:hover,
input[type="submit"]:hover,
.button:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
  background: var(--accent-color-hover);
}

/* ============================= */
/* PASSWORD VISIBILITY TOGGLE    */
/* ============================= */

/* 1. Space for the button so text never hides underneath */
.input-with-button > input[type="password"] {
  padding-right: 3rem;           /* 2 rem button + 1 rem breathing room */
}

/* 2. Reset everything the generic button rule set */
.input-with-button .toggle-password {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);

  display: flex;                 /* centres the emoji/SVG perfectly */
  align-items: center;
  justify-content: center;

  width: 2rem;
  height: 2rem;
  padding: 6px;                    /* <<< remove the inherited 0.75 rem */
  background: transparent;       /* <<< no white rectangle */
  border: none;
  cursor: pointer;
}

/* Eye icon (swap for SVG if you like) */
.input-with-button .toggle-password::before {
  content: '👁';
  font-size: 1.25rem;
  line-height: 1;
  color: var(--border-color);
}

/* Accent colour on hover/focus for accessibility */
.input-with-button .toggle-password:hover::before,
.input-with-button .toggle-password:focus-visible::before {
  color: var(--accent-color);
}

/* Centre container used on landing/auth pages */
.fullscreen-center {
  flex: 1;
  min-height: calc(100vh - 4rem); /* leaves room for nav if present */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  gap: 1rem;
}

/* Forms */
form {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.full-width-form{
  max-width: 100%;
}
input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-size: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 0;
}

/* Password toggle layout */
.input-with-button {
  position: relative;
}
.input-with-button .toggle-password {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  background: none;
  border: none;
  cursor: pointer;
}
.input-with-button .toggle-password::before {
  content: '👁';
  font-size: 1.25rem;
  line-height: 1;
}

/* Error message */
.error-message {
  width: 100%;
  max-width: 420px;
  padding: 1rem 1rem;
  background: var(--error-color);
  color: #fff;
  border-radius: 0.5rem;
  text-align: center;
}

/* ---------------------------------------- */
/* NAVIGATION BAR                          */
/* ---------------------------------------- */

.dh-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 999;
}

.dh-nav-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent-color);
}

/* Hamburger / close button */
.dh-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* Link list */
.dh-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;            /* hidden on mobile */
  flex-direction: column;
  gap: 1rem;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.dh-nav-links.open {        /* toggled via JS */
  display: flex;
}

.dh-nav-links li a {
  display: block;
  padding: 0.75rem 2rem;
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
}

.dh-nav-links li a:hover,
.dh-nav-links li a:focus-visible {
  text-decoration: none;
  background: var(--accent-color, #4A90E2); /* fallback to a nice blue */
  color: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  outline: none;
  transition: background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

@media (min-width: 768px) {
  .dh-nav-toggle {          /* hide hamburger on desktop */
    display: none;
  }
  .dh-nav-links {
    position: static;
    display: flex !important;   /* override mobile hidden */
    flex-direction: row;
    gap: 2rem;
    width: auto;
    background: none;
    border: none;
    box-shadow: none;
  }
  .dh-nav-links li a {
    padding: 0;
  }
}
/* ---------------------------------------- */
/* RESPONSIVE TWEAKS & DARK MODE           */
/* ---------------------------------------- */
@media (min-width: 640px) {
  .button,
  button,
  input[type="submit"] {
    padding: 0.75rem 2rem;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #111827; /* gray-900 */
    --text-color: #f3f4f6; /* gray-100 */
    --border-color: #374151; /* gray-700 */
  }

  body { background: var(--bg-color); }

  .dh-navbar { 
    background:#1f2937;
    border-bottom-color:#374151; 
  }
  .dh-nav-links {
    background:#1f2937;
    border-bottom-color:#374151; }
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.5rem 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu button {
  all: unset;
  box-sizing: border-box;
  display: block;
  width: 100%;
  padding: 0.5rem 2rem;
  line-height: 1.5;
  font-size: 1rem;
  font-family: var(--font-family);
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
  border-radius: 0.375rem;
  background-color: transparent;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.dropdown-menu button:hover,
.dropdown-menu button:focus-visible {
  background-color: var(--accent-color);
  color: white;
  outline: none;
}

.dropdown.open .dropdown-menu {
  display: block;
}

.dh-modal {
  padding: 2rem;
  border-radius: 0.5rem;
  border: none;
  width: 100%;
  max-width: 420px;
}

.dh-modal::backdrop {
  background: rgba(0, 0, 0, 0.4);
}

.dh-modal menu {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* Make dropdown toggle look like other links */
.dropdown-toggle-btn {
  display: block;
  padding: 0.75rem 2rem;
  color: var(--text-color);
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

.dropdown-toggle-btn:hover,
.dropdown-toggle-btn:focus-visible {
  background: var(--accent-color);
  color: #fff;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  outline: none;
  transition: background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-family: var(--font-family);
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.2s ease-in-out;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}

/* Primary (e.g. Rename) */
.btn-primary {
  background: var(--accent-color);
  color: white;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-color-hover);
}

/* Danger (Delete) */
.btn-danger {
  background: var(--error-color);
  color: white;
}
.btn-danger:hover,
.btn-danger:focus-visible {
  background: #dc2626; /* stronger red */
}

/* Outline (e.g. Download) */
.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}
.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--accent-color);
  color: white;
}

.btn-success {
  background: #10b981; /* emerald-500 */
  color: white;
}
.btn-success:hover,
.btn-success:focus-visible {
  background: #059669; /* emerald-600 */
}
.dh-sub-navbar {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 2rem;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  z-index: 998;
}

.dh-sub-links {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.dh-sub-navbar .dropdown-toggle-btn {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
}

.dh-sub-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.5rem 0;
}

.dh-sub-navbar .btn {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

.dh-sub-actions.centered {
  justify-content: center;
}

.full-width-textarea {
  width: 98vw !important;
  max-width: 98vw !important;
  height: 100% !important;
  margin-left: calc(-49vw + 50%);
  box-sizing: border-box;
  font-family: monospace;
}
