/* ===========================
   MIQURIOS COMPLETE STYLES
   =========================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  font-size: 36px;
  font-weight: 700;
  color: #1a4d7a;
  margin-bottom: 8px;
}

.tagline {
  font-size: 16px;
  color: #666;
}

/* ---------- Demo View (Not Logged In) ---------- */
.demo-view {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.demo-view.active {
  display: block;
}

.input-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.main-input {
  width: 100%;
  padding: 14px 40px 14px 14px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
}

.main-input:focus {
  outline: none;
  border-color: #336699;
}

.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #999;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.clear-btn:hover {
  background: #f0f0f0;
  color: #666;
}

.clear-btn.visible {
  display: flex;
}

.analyze-btn {
  width: 100%;
  padding: 14px;
  background: #336699;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.analyze-btn:hover {
  background: #2a5580;
}

.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hint {
  text-align: center;
  font-size: 13px;
  color: #666;
}

.hint a {
  color: #336699;
  text-decoration: none;
  font-weight: 600;
}

.auth-links {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 20px;
  font-size: 14px;
}

.auth-link {
  color: #336699;
  text-decoration: none;
  margin: 0 12px;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Dashboard View (Logged In) ---------- */
.dashboard-view {
  display: none;
}

.dashboard-view.active {
  display: block;
}

.dashboard-header {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.user-info {
  font-size: 14px;
  color: #666;
}

.logout-btn {
  padding: 8px 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  width: auto;
}

.logout-btn:hover {
  background: #e0e0e0;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: #336699;
  color: white;
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

.stat-value {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  opacity: 0.9;
}

/* ---------- Analysis Card ---------- */
.analysis-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #e0e0e0;
}

.analysis-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 15px;
}

.category-label {
  color: #336699;
  font-weight: 600;
}

.date-label {
  color: #999;
}

.analysis-header {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}

.source-link {
  color: #336699;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.analysis-body {
  /* Container for main content */
}

.analysis-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #333;
}

.takeaway-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
}

.takeaway-list li {
  padding-left: 20px;
  margin-bottom: 8px;
  line-height: 1.5;
  position: relative;
  font-size: 14px;
}

.takeaway-list li:before {
  content: "•";
  position: absolute;
  left: 6px;
  color: #336699;
}

.signal-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.signal-label {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.signal-score {
  font-size: 18px;
  color: #ffa726;
}

.question-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.question-header {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.question-text {
  background: #fcfcfc;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 0;
}

.chatgpt-link {
  color: #336699;
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 8px;
}

.chatgpt-link:hover {
  text-decoration: underline;
}

.reflection-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.reflection-section h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #666;
}

.reflection-box {
  width: 100%;
  background: #fcfcfc;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  color: #333;
  resize: vertical;
  min-height: 80px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.reflection-box:focus {
  outline: none;
  border-color: #336699;
  background: #fff;
}

.reflection-box:disabled {
  background: #fcfcfc;
  color: #999;
  cursor: not-allowed;
}

.reflection-box::placeholder {
  color: #999;
}

.reflection-status {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
  min-height: 14px;
}

/* ---------- Auth Modal ---------- */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-modal.active {
  display: flex;
}

.auth-modal-content {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-modal-header h2 {
  color: #1a4d7a;
  margin-bottom: 8px;
}

.auth-toggle {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-toggle button {
  flex: 1;
  padding: 10px;
  border: 2px solid #336699;
  background: white;
  color: #336699;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  width: auto;
}

.auth-toggle button.active {
  background: #336699;
  color: white;
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

.auth-form input:focus {
  outline: none;
  border-color: #336699;
}

.auth-form button {
  width: 100%;
  padding: 12px;
  background: #336699;
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.auth-form button:hover {
  background: #2a5580;
}

/* ---------- Utilities ---------- */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  background: white;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.empty {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  background: white;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.error {
  background: #fee;
  color: #c33;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 16px;
}

.cta-box {
  background: linear-gradient(135deg, #336699 0%, #06c9ff 100%);
  color: white;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  margin-top: 20px;
}

.cta-box h3 {
  color: white;
  font-size: 18px;
  margin-bottom: 8px;
  font-weight: 600;
}

.cta-box p {
  font-size: 14px;
  margin-bottom: 16px;
  opacity: 0.95;
}

.cta-btn {
  background: white;
  color: #336699;
  padding: 10px 24px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin: 0 6px;
  width: auto;
}

.cta-btn:hover {
  background: #f5f5f5;
}

.footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
  font-size: 13px;
}

.footer a {
  color: #336699;
  text-decoration: none;
  margin: 0 12px;
}

.footer a:hover {
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}
