/* =====================================================
   SHOGUN NO BACKEND TOOLS - UNIFIED STYLESHEET
   ===================================================== */

/* CSS Variables */
:root {
  --bg-color: #000000;
  --text-color: #ffffff;
  --border-color: #ffffff;
  --accent-color: #d71920;
  --font-stack: 'Space Mono', monospace;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base Body */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-stack);
  min-height: 100vh;
  min-height: 100dvh; /* Mobile full screen fix */
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
}

/* Typography */
h1 {
  font-size: 24px;
  font-weight: normal;
  letter-spacing: 4px;
  text-transform: uppercase;
}

h2 {
  font-size: 20px;
  font-weight: normal;
  letter-spacing: 3px;
  text-transform: uppercase;
}

h3 {
  font-size: 14px;
  font-weight: normal;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Container */
.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
header {
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  padding: 16px;
  margin-bottom: 20px;
}

/* Header-bar - standardized for tool pages */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.header-bar h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

/* Buttons */
button, .btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-family: var(--font-stack);
  padding: 12px 16px;
  cursor: pointer;
  text-transform: uppercase;
  font-size: 12px;
  transition: all 0.2s;
}

button:hover, .btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--text-color);
  color: var(--bg-color);
}

.btn-primary:hover {
  background: var(--accent-color);
  color: var(--text-color);
}

.btn-danger {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.btn-danger:hover {
  background: var(--accent-color);
  color: var(--text-color);
}

.btn-dashed {
  border-style: dashed;
}

/* Form Elements */
input, textarea, select {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-family: var(--font-stack);
  padding: 12px;
  font-size: 14px;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--accent-color);
}

input::placeholder, textarea::placeholder {
  color: var(--text-color);
  opacity: 0.5;
}

label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.7;
}

.field {
  margin-bottom: 16px;
}

/* Toolbar - fixed bottom navigation */
.toolbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--bg-color);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 16px;
  z-index: 50;
}

.toolbar a, .toolbar button {
  color: var(--text-color);
  text-decoration: none;
  font-family: var(--font-stack);
  font-size: 14px;
  text-transform: uppercase;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.toolbar a:hover, .toolbar button:hover {
  opacity: 0.7;
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-color);
  color: var(--bg-color);
  padding: 8px 16px;
  font-size: 12px;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

.toast.show {
  opacity: 1;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  padding: 24px;
  width: 90%;
  max-width: 400px;
}

.modal-content h3 {
  text-transform: uppercase;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.modal-buttons button {
  flex: 1;
}

/* Cards */
a.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  padding: 24px 16px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s;
  text-align: center;
  background: transparent;
}

a.card:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

.card-name {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: bold;
}

.card-desc {
  font-size: 10px;
  margin-top: 8px;
  opacity: 0.7;
  text-transform: uppercase;
}

/* Grid layout */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

/* Empty state */
.empty, .empty-state {
  text-align: center;
  padding: 40px;
  opacity: 0.5;
  text-transform: uppercase;
  font-size: 12px;
  border: 1px dashed var(--border-color);
}

/* Dot matrix overlay effect */
.matrix-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 9999;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #333;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 18px;
  }
}

/* Utility classes */
.text-center { text-align: center; }
.text-uppercase { text-transform: uppercase; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.pb-100 { padding-bottom: 100px; }

/* Theme toggle button */
#themeToggle {
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: var(--font-stack);
  font-size: 14px;
  cursor: pointer;
  padding: 8px;
}

/* Footer link */
footer a {
  color: inherit;
  text-decoration: none;
}

footer a:hover {
  opacity: 0.7;
}

/* Footer buttons and links */
.footer-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-family: var(--font-stack);
  font-size: 10px;
  padding: 4px 12px;
  cursor: pointer;
  text-transform: uppercase;
}

.footer-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

.footer-btn.install-btn {
  background: #22c55e;
  border-color: #22c55e;
  color: #000;
  font-weight: bold;
}

.footer-link {
  background: transparent;
  border: none;
  color: var(--text-color);
  font-family: var(--font-stack);
  font-size: 10px;
  cursor: pointer;
  opacity: 0.7;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-link:hover {
  opacity: 1;
}

/* ==================== LIGHT THEME ==================== */
.light-theme {
  --bg-color: #f5f5f5;
  --text-color: #1a1a1a;
  --border-color: #333333;
}

.light-theme .matrix-overlay {
  background-image: radial-gradient(#999 1px, transparent 1px);
  opacity: 0.03;
}

/* Buttons in light theme */
.light-theme button,
.light-theme .btn {
  background: transparent;
  border-color: var(--text-color);
  color: var(--text-color);
}

.light-theme button:hover,
.light-theme .btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

.light-theme .btn-primary {
  background: var(--text-color);
  color: var(--bg-color);
}

.light-theme .btn-primary:hover {
  background: var(--accent-color);
  color: #fff;
}

/* Cards in light theme */
.light-theme a.card {
  border-color: var(--border-color);
  background: #fff;
}

.light-theme a.card:hover {
  background: var(--text-color);
  color: #fff;
}

/* Inputs in light theme */
.light-theme input,
.light-theme textarea,
.light-theme select {
  background: #fff;
  border-color: var(--border-color);
  color: var(--text-color);
}

.light-theme input::placeholder,
.light-theme textarea::placeholder {
  color: #666;
}

/* Toolbar in light theme */
.light-theme .toolbar {
  background: var(--bg-color);
  border-top-color: var(--border-color);
}

.light-theme .toolbar a,
.light-theme .toolbar button {
  color: var(--text-color);
}

/* Footer in light theme */
.light-theme footer a {
  color: var(--text-color);
}

/* Toast in light theme */
.light-theme .toast {
  background: var(--text-color);
  color: var(--bg-color);
}

/* Modal in light theme */
.light-theme .modal-content {
  background: #fff;
}

/* Scrollbar */
.light-theme ::-webkit-scrollbar-thumb {
  background: #ccc;
}

.light-theme ::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

/* Smooth theme transition */
body {
  transition: background-color 0.3s, color 0.3s;
}

/* ==================== SYNC INDICATOR ==================== */
.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  text-transform: uppercase;
  opacity: 0.7;
}

.sync-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #666;
}

.sync-indicator.synced::before {
  background: #22c55e;
}

.sync-indicator.syncing::before {
  background: #eab308;
  animation: pulse 1s infinite;
}

.sync-indicator.offline::before {
  background: #ef4444;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

