/* =========================================
   GLOBAL BASE
========================================= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f9fc;
}

.hidden {
  display: none;
}

.error {
  color: #e74c3c;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}

/* =========================================
   LOGIN / REGISTER (NO SIDEBAR)
========================================= */

body.login-page {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #0a3d62, #07456d);
}

.card {
  width: 420px;
  background: #ffffff;
  padding: 32px 40px;
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.card h1 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 30px;
}

.card label {
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
  font-weight: 600;
}

.card input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid #dcdde1;
  font-size: 14px;
}

.card button {
  width: 100%;
  padding: 10px;
  margin-top: 16px;
  border-radius: 8px;
  border: none;
  background: #00c6ff;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* =========================================
   FIXED LEFT SIDEBAR
========================================= */

#sidebar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: #07456d;
  color: white;
  z-index: 100;
  box-shadow: 3px 0 10px rgba(0,0,0,0.25);
}

.sidebar {
  height: 100%;
  padding: 30px 25px;
  background: #07456d;
  color: white;
}

.sidebar .logo {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 40px;
}

.sidebar label {
  font-size: 13px;
  color: #cfe7ff;
  margin-bottom: 4px;
  display: block;
}

.sidebar select {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  border: none;
  margin-bottom: 20px;
}

.sidebar nav a {
  display: block;
  color: #cfe7ff;
  text-decoration: none;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: rgba(255,255,255,0.15);
  color: white;
}

.logout-btn {
  margin-top: 40px;
  width: 100%;
  padding: 12px;
  background: #c0392b;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 15px;
  cursor: pointer;
}

/* =========================================
   PAGE CONTENT (RIGHT OF SIDEBAR)
========================================= */

.page-content {
  margin-left: 260px;
  padding: 40px 50px;
  min-height: 100vh;
  background: #f7f9fc;
}

/* =========================================
   INPUT WORKSPACE (DESKTOP-LIKE)
========================================= */

.input-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.input-toolbar button {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #ccc;
  background: #ffffff;
  cursor: pointer;
}

.input-workspace {
  width: 100%;
  min-height: 220px;
  max-height: 420px;
  resize: vertical;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #dcdde1;
  font-size: 14px;
  line-height: 1.5;
  background: #ffffff;
}

/* =========================================
   OUTPUT SECTIONS
========================================= */

.section {
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  margin-bottom: 16px;
}

.section.preformatted {
  white-space: pre-wrap;
}

/* =========================================
   IMAGE INPUT UI
========================================= */

.image-drop-zone {
  border: 2px dashed #bdc3c7;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  color: #7f8c8d;
  font-size: 14px;
  margin-top: 10px;
  margin-bottom: 6px;
  background: #f8f9fb;
  cursor: pointer;
}

.image-drop-zone.dragover {
  border-color: #2980b9;
  background: #ecf5ff;
}

.image-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.image-thumb {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  border: 1px solid #dcdde1;
  object-fit: cover;
}

/* =========================================
   SPINNER + PROGRESS
========================================= */

.spinner {
  position: fixed;
  top: 45%;
  left: 50%;
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  border: 6px solid #eee;
  border-top-color: #3498db;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  z-index: 99999;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#spinner-overlay-text {
  position: fixed;
  top: calc(45% + 70px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #2c3e50;
}

.progress-steps {
  display: flex;
  gap: 8px;
  margin: 10px 0;
  font-size: 13px;
}

.progress-step {
  padding: 4px 10px;
  border-radius: 999px;
  background: #ecf0f1;
  border: 1px solid #bdc3c7;
  color: #7f8c8d;
}

.progress-step.step-active {
  background: #3498db;
  color: white;
  border-color: #2980b9;
}

.progress-step.step-done {
  background: #2ecc71;
  color: white;
  border-color: #27ae60;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 800px) {
  #sidebar-container {
    position: static;
    width: 100%;
    height: auto;
  }

  .page-content {
    margin-left: 0;
    padding: 20px;
  }

  .input-workspace {
    min-height: 180px;
  }
}
