/* Import fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #2c3333;

  --fg: #dfe6e9;

  --accent: #6fb98f;

  --highlight: #9ad3bc;

  --input-bg: #3a4a4a;

  --input-border: #557b83;

  --shadow: rgba(0, 0, 0, 0.4);
}

#passwordInput {
  flex: 1;

  font-size: 0.72rem;

  padding: 4px 6px;

  background-color: var(--input-bg);

  border: 1px solid var(--input-border);

  border-radius: 4px;

  color: var(--fg);

  box-sizing: border-box;
}

#passwordInput:focus {
  outline: none;

  border-color: var(--input-border-focus);
}

#esolveInput {
  flex: 1;

  font-size: 0.72rem;

  padding: 4px 6px;

  background-color: var(--input-bg);

  border: 1px solid var(--input-border);

  border-radius: 4px;

  color: var(--fg);

  box-sizing: border-box;
}

#esolveInput:focus {
  outline: none;

  border-color: var(--input-border-focus);
}

#ffupUserLabel {
  white-space: nowrap;

  overflow: visible;

  text-overflow: unset;
}

#usernameInput {
  flex: 1;

  font-size: 0.72rem;

  padding: 4px 6px;

  background-color: var(--input-bg);

  border: 1px solid var(--input-border);

  border-radius: 4px;

  color: var(--fg);

  box-sizing: border-box;
}

#usernameInput[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
  background-color: #2c3333;
}

#usernameInput:focus {
  outline: none;

  border-color: var(--input-border-focus);
}

.field select {
  flex: 1;

  font-size: 0.72rem;

  padding: 4px 6px;

  background-color: var(--input-bg);

  border: 1px solid var(--input-border);

  border-radius: 4px;

  color: var(--fg);

  box-sizing: border-box;
}

.field select:focus {
  outline: none;

  border-color: var(--input-border-focus);
}

body {
  font-family: "Segoe UI", sans-serif;

  background-color: var(--bg);

  color: var(--fg);

  margin: 0;

  padding: 0;

  overflow-x: hidden;
}

.container {
  width: 100%;

  padding: 0 15px;

  box-sizing: border-box;
}

.top-nav {
  display: flex;

  justify-content: space-between;

  margin: 1.5rem 0 1rem;
}

.top-nav button {
  flex: 1;

  margin: 0 4px;

  padding: 3px 6px;

  font-size: 0.6rem;

  font-weight: 600;

  background-color: var(--input-bg);

  color: var(--fg);

  border: 1px solid var(--input-border);

  border-radius: 4px;

  cursor: pointer;

  transition: background-color 0.2s;
}

.top-nav button:hover {
  background-color: var(--accent);

  color: var(--bg);
}

.top-nav button.active {
  background-color: var(--accent);

  color: var(--bg);

  border-color: var(--accent);
}

.wrapper {
  max-width: 450px;

  margin: 0 auto;

  padding: 1rem;

  border-radius: 6px;

  background-color: var(--bg);

  box-shadow: 0 1px 6px var(--shadow);

  box-sizing: border-box;
}

.field {
  display: flex;

  align-items: center;

  margin-bottom: 12px;
}

.field label {
  width: 110px;

  font-size: 0.72rem;

  font-weight: 600;

  color: var(--accent);

  margin-right: 6px;
}

.field input[type="text"],
.field textarea {
  flex: 1;

  font-size: 0.72rem;

  padding: 4px 6px;

  background-color: var(--input-bg);

  border: 1px solid var(--input-border);

  border-radius: 4px;

  color: var(--fg);

  box-sizing: border-box;
}

.field input[type="text"]:focus,
.field textarea:focus {
  outline: none;

  border-color: var(--input-border-focus);
}

.field textarea {
  height: 120px;
  resize: vertical;
}

#newWocas {
  height: 50px;  /* Shorter than the default 120px */
  resize: vertical;
}

#newRemarks {
  height: 60px;
  resize: vertical;
}

#escAddress {
  height: 80px;
  resize: vertical;
}

#wocas {
  height: 50px;
  resize: vertical;
}

.divider-box {
  background-color: transparent;

  color: var(--highlight);

  font-size: 0.75rem;

  font-weight: bold;

  padding: 6px 0;

  margin: 1rem 0 0.5rem;

  border-bottom: 1px solid var(--input-border);
}

.button-row {
  display: flex;

  gap: 8px;

  justify-content: flex-end;

  margin-top: 1rem;
}

.button-row button {
  font-size: 0.65rem;

  padding: 4px 10px;

  background-color: var(--input-bg);

  color: var(--fg);

  border: 1px solid var(--input-border);

  border-radius: 4px;

  cursor: pointer;
}

.button-row button:hover {
  background-color: var(--accent);

  color: var(--bg);
}

@media (max-width: 480px) {
  .field {
    flex-direction: column;

    align-items: stretch;
  }

  .field label {
    width: 100%;

    margin-bottom: 4px;
  }

  .field input[type="text"],
  .field textarea {
    width: 100%;
  }

  .top-nav {
    flex-direction: column;

    gap: 6px;
  }

  .top-nav button {
    width: 100%;

    margin: 0;
  }
}

/* ========================================================================== */

/* SECRET CONSOLE STYLES */

/* ========================================================================== */

#secretConsole {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 300px;
  background: rgba(26, 31, 26, 0.98);
  border-top: 2px solid var(--accent);
  z-index: 9999;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  box-shadow: 0 -4px 20px var(--shadow);
}

#secretConsole .console-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  padding: 8px 12px;

  background: var(--accent);

  color: var(--bg);

  font-weight: bold;

  font-size: 0.75rem;
}

#secretConsole .console-close {
  cursor: pointer;

  user-select: none;
}

#secretConsole .console-close:hover {
  color: var(--highlight);
}

#consoleOutput {
  height: 220px;
  overflow-y: auto;
  padding: 10px;
  font-size: 0.7rem;
  color: var(--fg);
  line-height: 1.4;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}

#consoleOutput::-webkit-scrollbar {
  width: 8px;
}

#consoleOutput::-webkit-scrollbar-track {
  background: var(--input-bg);
}

#consoleOutput::-webkit-scrollbar-thumb {
  background: var(--input-border);

  border-radius: 4px;
}

#consoleOutput::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

#secretConsole .console-input-wrapper {
  display: flex;

  padding: 8px;

  background: var(--input-bg);

  border-top: 1px solid var(--input-border);
}

#secretConsole .console-prompt {
  color: var(--accent);

  margin-right: 8px;

  font-weight: bold;
}

#consoleInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.75rem;
}

#consoleInput::placeholder {
  color: var(--input-border);

  opacity: 0.6;
}

/* Console entry animations */

#consoleOutput div {
  animation: fadeIn 0.2s ease-in;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;

    transform: translateY(-5px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

/* Responsive adjustments for console */

@media (max-width: 480px) {
  #secretConsole {
    height: 250px;
  }

  #consoleOutput {
    height: 170px;
  }
}

/* Apply Source Code Pro to all elements */
* {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

}


/* Login footer note */
.login-footer-note {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--input-border);
  font-size: 0.72rem;
  color: var(--fg);
  text-align: center;
  line-height: 1.6;
  opacity: 0.8;
}

.login-footer-note strong {
  color: var(--accent);
  font-weight: 600;
}

/* ========================================================================== */

/* TOAST NOTIFICATION STYLES */

/* ========================================================================== */

#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--accent);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px var(--shadow);
  font-size: 0.8rem;
  font-weight: 500;
  min-width: 200px;
  max-width: 350px;
  pointer-events: auto;
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.success {
  background: var(--accent);
}

.toast.error {
  background: #e74c3c;
}

.toast.info {
  background: var(--highlight);
  color: var(--bg);
}

.toast.warning {
  background: #f39c12;
  color: var(--bg);
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.toast.hiding {
  animation: slideOut 0.3s ease-in forwards;
}

@media (max-width: 480px) {
  #toastContainer {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .toast {
    min-width: unset;
    max-width: unset;
  }
}

/* ========================================================================== */
/* QUICK FILL SYSTEM STYLES */
/* ========================================================================== */

.quick-fill-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--highlight) 100%) !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(111, 185, 143, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(111, 185, 143, 0.3);
  }
  50% {
    box-shadow: 0 2px 12px rgba(111, 185, 143, 0.6);
  }
}

.quick-fill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(111, 185, 143, 0.5) !important;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.2s ease-in;
}

.modal-content {
  background-color: var(--bg);
  margin: 3% auto;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  box-shadow: 0 4px 20px var(--shadow);
  animation: slideDown 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background-color: var(--accent);
  color: var(--bg);
  border-radius: 6px 6px 0 0;
  flex-shrink: 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--bg);
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--input-bg);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* Quick Fill Search */
.quick-fill-search {
  margin-bottom: 1rem;
}

.quick-fill-search input {
  width: 100%;
  padding: 10px 12px;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--fg);
  font-size: 0.85rem;
  box-sizing: border-box;
}

.quick-fill-search input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Categories */
.quick-fill-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.category-btn {
  padding: 6px 14px;
  background-color: var(--input-bg);
  color: var(--fg);
  border: 1px solid var(--input-border);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.category-btn:hover {
  background-color: var(--input-border);
}

.category-btn.active {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* Quick Fill List */
.quick-fill-list {
  display: grid;
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
}

.quick-fill-item {
  padding: 1rem;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-fill-item:hover {
  background-color: var(--input-border);
  border-color: var(--accent);
  transform: translateX(5px);
}

.quick-fill-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.quick-fill-item-name {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.9rem;
}

.quick-fill-item-category {
  padding: 2px 8px;
  background-color: var(--accent);
  color: var(--bg);
  border-radius: 12px;
  font-size: 0.6rem;
  font-weight: 600;
}

.quick-fill-item-description {
  font-size: 0.75rem;
  color: var(--fg);
  opacity: 0.8;
  line-height: 1.4;
}

.quick-fill-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--fg);
  opacity: 0.6;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    max-height: 90vh;
  }

  .quick-fill-categories {
    justify-content: center;
  }

  .category-btn {
    flex: 1;
    min-width: 60px;
  }

  .quick-fill-list {
    max-height: 60vh;
  }

  .quick-fill-item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* ========================================================================== */
/* CONFIRMATION MODAL STYLES */
/* ========================================================================== */

.confirm-modal-content {
  max-width: 450px;
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.confirm-message {
  text-align: center;
  font-size: 0.9rem;
  color: var(--fg);
  margin: 1.5rem 0;
  line-height: 1.6;
}

.confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 1.5rem;
}

.confirm-btn {
  padding: 10px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 120px;
}

.confirm-yes {
  background-color: #e74c3c;
  color: white;
}

.confirm-yes:hover {
  background-color: #c0392b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.confirm-no {
  background-color: var(--input-bg);
  color: var(--fg);
  border: 1px solid var(--input-border);
}

.confirm-no:hover {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .confirm-modal-content {
    width: 90%;
  }
  
  .confirm-buttons {
    flex-direction: column;
  }
  
  .confirm-btn {
    width: 100%;
  }
}

/* ========================================================================== */
/* UNLOAD WARNING MODAL */
/* ========================================================================== */

.unload-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  padding: 16px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 10002;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: slideInTop 0.3s ease-out;
  display: none;
}

@keyframes slideInTop {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.unload-warning.show {
  display: block;
}
