/* ========== MAIN STYLES ========== */
* {
  box-sizing: border-box;
  user-select: none;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  background: #0C0F12;
  background-image: radial-gradient(circle at 30% 10%, #1A1E24 0%, #070A0D 90%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 20px 20px;
  margin: 0;
  color: #C0C5CB;
  min-height: 100vh;
  position: relative;
}

/* Main App Container */
#app-container {
  display: none;
  width: 100%;
}

#app-container.visible {
  display: block;
}

/* ========== AUTH MODAL STYLES ========== */
#auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 13, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

#auth-content {
  background: #11171E;
  border: 1px solid #3E4349;
  border-radius: 4px;
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

#auth-content h2 {
  margin: 0 0 8px 0;
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: -0.5px;
  background: linear-gradient(180deg, #B7BDBF 0%, #8A9298 70%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.auth-tabs {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 1px solid #3E4349;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #C0C5CB;
  transition: all 0.2s ease;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.auth-tab:hover {
  color: #D6CCBC;
}

.auth-tab.active {
  color: #D6CCBC;
  border-bottom: 2px solid #8B7355;
}

#auth-content input {
  width: 100%;
  padding: 14px;
  margin: 8px 0;
  background: #0E1318;
  border: 1px solid #3B4047;
  border-radius: 2px;
  color: #D3D8DD;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

#auth-content input:focus {
  border-color: #8B6F5E;
  box-shadow: 0 0 0 2px rgba(155, 110, 75, 0.25);
  background: #11171E;
  color: #F0EEE6;
}

#auth-content input::placeholder {
  color: #7A828A;
  font-weight: 400;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  margin-top: 16px;
  background: #2B2A28;
  color: #DBD5CD;
  border: 1px solid #5E5245;
  font-weight: 700;
  border-radius: 2px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.auth-btn:hover {
  background: #3E3A34;
  border-color: #8B7355;
  color: #FAF7F2;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.8);
}

.auth-btn:active {
  transform: translateY(0px);
}

/* ========== MAIN APP STYLES ========== */

/* EXIT button on top of h1 */
.exit-bottom {                    /* renamed for clarity */
  display: flex;
  justify-content: center;
  padding: 30px 20px 20px 20px;
  width: 100%;
  background: transparent;
  margin-top: auto;               /* pushes it to bottom */
}

#logout-btn {
  background: linear-gradient(135deg, #1F1B17 0%, #17130F 100%);
  border: 1px solid #5E5245;
  color: #DBD5CD;
  padding: 12px 32px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
  letter-spacing: 0.7px;
  text-transform: uppercase;
  white-space: nowrap;
}

#logout-btn:hover {
  background: linear-gradient(135deg, #3E3A34 0%, #2A2520 100%);
  border-color: #8B7355;
  color: #FAF7F2;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.85);
}

/* Header section */
.header-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 20px 16px 20px;
  background: #1A1F24;
  border-bottom: 1px solid #3A3F45;
  position: relative;
  width: 100%;
}

h1 {
  cursor: pointer;
  font-weight: 900;
  font-size: 2.65rem;        /* Increased from 2.2rem */
  margin: 0;
  letter-spacing: -0.8px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #D4C9B8 0%, #9E8F7A 70%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 3px 8px rgba(0,0,0,0.75);
  filter: drop-shadow(0 3px 6px #00000060);
  text-align: center;
  line-height: 1.1;
}

/* Top bar */
#top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #0E1216;
  border-bottom: 1px solid #2A2F35;
  width: 100%;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

#feeling-input {
  flex: 2;
  min-width: 250px;
  padding: 14px 18px;
  font-size: 0.95rem;
  border: 1px solid #3B4047;
  border-radius: 2px;
  background: #0E1318;
  outline: none;
  transition: all 0.2s;
  font-weight: 500;
  color: #D3D8DD;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.6);
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
  height: 77px;  /* ADD THIS LINE - fits 2 lines of placeholder text */
}

#feeling-input:focus {
  border-color: #8B6F5E;
  box-shadow: 0 0 0 2px rgba(155, 110, 75, 0.25), inset 0 1px 5px black;
  background: #11171E;
  color: #F0EEE6;
}

/* Action group - submit button and username */
.action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

#submit-btn {
  white-space: nowrap;
  background: #2F2A25;
  color: #DBD5CD;
  border: 1px solid #5E5245;
  padding: 12px 32px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.7);
  letter-spacing: 0.7px;
  text-transform: uppercase;
  min-width: 170px;
}

#submit-btn:hover {
  background: #3E3A34;
  border-color: #8B7355;
  color: #FAF7F2;
}

#submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Username on the right side of submit button */
.user-info {
  display: none;
  align-items: center;
  font-size: 0.85rem;
  color: #D6CCBC;
  font-weight: 500;
  padding: 6px 14px;
  background: rgba(60, 65, 70, 0.7);
  border-radius: 6px;
  border: 1px solid #4A4F55;
  white-space: nowrap;
}

.user-info::before {
  content: "◈";
  color: #9CA3AF;
  margin-right: 6px;
}

/* Button row below path */
.button-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 10px;
  margin-bottom: 20px;
}

#show-tree-btn, #manual-map-btn {
  background: #161B21;
  border: 1px solid #5C5F64;
  color: #D0D4D8;
  padding: 8px 18px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.8);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

#show-tree-btn:hover, #manual-map-btn:hover {
  background: #2A3139;
  border-color: #8B7A6B;
  color: #EAE6E0;
  transform: translateY(-1px);
}

.manual-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 8px auto;
  justify-content: center;
  flex-wrap: wrap;
}

#manual-word-input {
  padding: 10px 16px;
  font-size: 0.9rem;
  background: #0E1318;
  border: 1px solid #3B4047;
  color: #D3D8DD;
  border-radius: 2px;
  min-width: 220px;
  outline: none;
}

#manual-word-input:focus {
  border-color: #8B6F5E;
  background: #11171E;
}

#lookup-btn {
  background: #1D232A;
  border: 1px solid #4A4E54;
  color: #D0D4D8;
  padding: 10px 18px;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#manual-feedback {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 18px auto;
  text-align: center;
  color: #C0B6A6;
  font-weight: 500;
  font-size: 0.9rem;
  min-height: 24px;
  background: rgba(10,14,18,0.8);
  backdrop-filter: blur(8px);
  padding: 6px 12px;
  border-radius: 2px;
  border: 1px solid #3E4349;
  display: none;
}

/* LLM Response Styles */
#llm-response {
  margin: 10px auto 10px auto;  /* Vertical spacing above and below, horizontal centering */
  padding: 16px 20px;
  background: rgba(30, 35, 40, 0.7);
  border: 1px solid #5A5E63;
  border-left: 3px solid #BBA68C;
  border-radius: 4px;
  animation: fadeInUp 0.6s ease-out;
  width: 100%;
  max-width: 1200px;  
  display: flex;
  flex-direction: column;
  align-items: center;  
  justify-content: center;  
}

#llm-response-content {
  color: #D6CCBC;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

#llm-response-label {
  color: #8C8980;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-top: 1px solid rgba(138, 137, 128, 0.3);
  padding-top: 8px;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#llm-response.loading {
  opacity: 0.6;
}

#main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 30px auto;
  gap: 30px;
}

#wheel-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}

#wheel-container {
  position: relative;
  width: 560px;
  height: 560px;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.8));
  margin: 0 auto;
}

canvas {
  border-radius: 50%;
  background: #0C1014;
  transition: all 0.08s linear;
  cursor: pointer;
  width: 100%;
  height: 100%;
  box-shadow: 0 0 0 2px #3A3E44, 0 16px 36px black;
  font-size-adjust: 0.5;
}

#intensity-scale {
  background: rgba(14, 17, 22, 0.9);
  backdrop-filter: blur(16px);
  padding: 12px 28px;
  border-radius: 2px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.7);
  width: 100%;
  max-width: 500px;
  text-align: center;
  border: 1px solid #4E5358;
}

#intensity-scale strong {
  font-size: 0.9rem;
  color: #B7A797;
  letter-spacing: 0.5px;
  font-weight: 400;
  text-transform: uppercase;
}

.slider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
}

.slider-container span {
  font-weight: 700;
  font-size: 1.1rem;
  color: #9E8C7C;
}

input[type="range"] {
  width: 250px;
  accent-color: #8B7355;
  background: #1F262D;
  height: 4px;
  border-radius: 2px;
}

#info, #path {
  text-align: center;
  font-weight: 600;
}

#info {
  font-size: 1.25rem;
  font-weight: 700;
  background: #0C1116dd;
  display: inline-block;
  padding: 6px 26px;
  border-radius: 2px;
  color: #D1C7BA;
  backdrop-filter: blur(16px);
  margin-top: 6px;
  border: 1px solid #3B4147;
  letter-spacing: -0.2px;
}

#path {
  font-size: 0.8rem;
  color: #9A9990;
  background: #11161C;
  padding: 5px 15px;
  border-radius: 2px;
  font-weight: 500;
  border: 1px solid #2F343A;
  margin-top: 5px;
}

#tree-panel {
  width: 100%;
  max-width: 900px;
  background: rgba(10, 14, 18, 0.97);
  backdrop-filter: blur(12px);
  border-radius: 2px;
  padding: 22px 24px;
  box-shadow: 0 20px 30px -15px black;
  border: 1px solid #3E4349;
  margin-top: 0px;
  transition: all 0.2s ease;
}

#emotions-tree {
  font-size: 0.85rem;
  color: #B3B9BF;
}

#emotions-tree h3 {
  font-size: 1.2rem;
  margin: 0 0 20px 0;
  color: #ACA197;
  font-weight: 700;
  border-left: 4px solid #7A6A5C;
  padding-left: 16px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

#emotions-tree ul {
  margin: 8px 0 12px 0;
  padding-left: 20px;
}

#emotions-tree li {
  margin-bottom: 10px;
  line-height: 1.5;
  color: #A0A4A8;
}

.tree-primary {
  font-weight: 800;
  font-size: 0.95rem;
  color: #CFC5B6;
  letter-spacing: 0.4px;
  margin-top: 12px;
  display: inline-block;
}

.tree-placeholder {
  text-align: center;
  padding: 28px 8px;
  color: #8E8B81;
}

.tree-placeholder h3 {
  margin: 0 0 8px;
  color: #9A9386;
}

.sovereign-footer {
  margin-top: 30px;
  padding: 20px 20px 16px;
  text-align: center;
  width: 100%;
  border-top: 1px solid #2C3137;
  background: rgba(7, 10, 13, 0.6);
  backdrop-filter: blur(4px);
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  color: #90969C;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 12px;
}

.footer-credit {
  font-weight: 500;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #C7BDAC, #9D9282);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  display: inline-block;
}

/* ========== RESPONSIVE STYLES ========== */

@media (max-width: 900px) {
  #top-bar {
    flex-wrap: wrap;
  }
  
  #feeling-input {
    min-width: 100%;
    order: 1;
    width: 100%;
  }
  
  .action-group {
    order: 2;
    margin-left: auto;
  }
}

@media (max-width: 700px) {
  #wheel-container {
    width: 440px;
    height: 440px;
  }
  canvas {
    width: 440px;
    height: 440px;
  }
  
  .button-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.2rem;
  }
  
  .action-group {
    gap: 6px;
  }
  
  #submit-btn {
    text-align: center;
    padding: 8px 16px;
    font-size: 0.75rem;
  }
  
  .user-info {
    font-size: 0.7rem;
    padding: 3px 8px;
  }
  
  .button-row {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  #show-tree-btn, #manual-map-btn {
    width: 100%;
    text-align: center;
    padding: 8px 18px;
  }
}

@media (max-width: 520px) {
  #wheel-container {
    width: 340px;
    height: 340px;
  }
  canvas {
    width: 340px;
    height: 340px;
  }
}