@tailwind base;
@tailwind components;
@tailwind utilities;

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #d3d3d3;
}

header {
  flex: 0 0 72px;
}

main {
  flex: 1 1 auto;
}

/* ----- Suggestion Dropdowns ----- */
.suggestions-container {
  position: relative;
  width: 100%;
}

.suggestions-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  margin-top: 2px;
  padding: 0;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 14px;
  z-index: 1000;
  list-style: none;
  transition: visibility 0s 0.2s;
}

.suggestions-list li {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f1f1;
  cursor: pointer;
}

.suggestions-list li:last-child {
  border-bottom: none;
}

.suggestions-list li:hover {
  background-color: #f9f9f9;
  color: #0073e6;
  font-weight: 500;
}

/* ----- Dynamic Panel ----- */
#dynamic-panel {
  position: relative;
  z-index: 1;
  background-color: oklch(98.5% 0 0);
  visibility: visible !important;
  opacity: 1 !important;
  margin-bottom: 0;
}

#dynamic-panel button {
  min-height: 60px;
}

/* ----- Example Texts ----- */
.example-text {
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.example-text:hover {
  color: #60a5fa;
}

/* ----- Fullscreen Preview ----- */
/* ----- Fullscreen Preview ----- */
.fullscreen-preview {
  position: fixed;
  inset: 0; /* shorthand for top:0; left:0; right:0; bottom:0 */
  width: 100vw;
  height: 100vh;
  background-color: #065f46;

  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;

  z-index: 9999;           /* ⬆️ ensure it covers everything */
  transition: all 0.6s ease-in-out;

  padding: 0 2rem;         /* for breathing room on sides */
  overflow: hidden;        /* hides any stray panels behind */
}

.fullscreen-preview span {
  color: white;
  text-decoration: none !important;
}


.fullscreen-preview.fade-in {
  opacity: 0;
  transform: scale(0.9);
  animation: fadeZoomIn 0.8s forwards;
}

@keyframes fadeZoomIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}


/* ============================
   🧠 Agentic AI Helper — top right FIXED
============================ */
#agentic-ai-helper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background-color: white;
  border: 1px solid #dcdcdc;
  border-radius: 0.75rem;
  padding: 1rem 1rem 0.75rem 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 9999;

  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translate(20px, -10px);
  transition: all 0.4s ease;
}

/* when shown */
#agentic-ai-helper.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, 0);
}

/* close button */
#ai-close-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  color: #6b7280;
  font-size: 1.1rem;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  z-index: 10000;
}

#agentic-ai-helper.high {
  bottom: 140px;
}

#ai-close-btn:hover {
  color: #ef4444;
}

#objective-preview {
  display: inline-block;           /* keeps multi-line text together */
  word-break: keep-all;            /* no mid-word breaks */
  overflow-wrap: break-word;       /* wrap normally at spaces */
  white-space: normal;             /* allow wrapping */
  line-height: 1.5;
  text-align: center;
  color: white;
  max-width: 80%;                  /* prevent overly wide text */
  margin: 0 auto;
}



#objective-preview.fullscreen-preview {
  font-size: 1.5rem !important;
  margin-top: 10vh;
}

#objective-preview.fullscreen-preview span {
  font-size: inherit;
}


/* ===== Bottom Action Bar ===== */
#bottom-actions {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: none; /* 👈 hide entire bar initially */
  gap: 1rem;
  justify-content: center;
  align-items: center;
  z-index: 100005;
}

#bottom-actions.show {
  display: flex; /* 👈 shown when ready */
}

/* Buttons inside the bar share consistent style */
#bottom-actions button,
#bottom-actions a {
  display: inline-block;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: 2px solid transparent;
  transition: background 0.2s, transform 0.2s;
}

/* Individual button styles */
#restart-button {
  background-color: #ffffff;
  color: #065f46;
  border-color: #065f46;
}

#restart-button:hover {
  transform: translateY(-2px);
}

.btn-wida {
  background-color: #2563eb;
  color: white;
}

.btn-wida:hover {
  background-color: #1d4ed8;
}

#copy-button {
  background-color: yellow;
  color: green;
  border-color: rgba(255, 255, 255, 0.6);
}

#copy-button:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

#agentic-ai-helper {
  z-index: 100001 !important;
}

body.fullscreen-active {
  overflow: hidden;
  background-color: #065f46; /* match fullscreen color */
}

