/*
 * Global stylesheet for the "Let Me ChatGPT That For You" web app.
 *
 * The design takes inspiration from the ChatGPT interface: a dark
 * environment with soft rounded rectangles and subtle iconography. Colours
 * are defined as CSS variables to make tweaking the palette simpler.
 */

:root {
  --bg-color: #212121;        /* page background */
  --bar-color: #303030;       /* search bar background */
  --bar-alt-color: #ffffff;   /* accent for icons */
  --text-color: #f5f5f5;      /* primary text colour */
  --placeholder-color: #9c9c9c; /* placeholder text */
  --icon-color: #000000;      /* default icon colour */
  --highlight-color: #e0e0e0; /* highlight accent */
  --button-bg: #ffffff;       /* copy button background */
  --button-bg-hover: #e0e0e0; /* copy button hover */
}

/* Reset some default styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  padding-top: 0vh;
}

.wrapper {
  width: 100%;
  max-width: 768px;
  margin-top: -14.5vh;
  position: relative;
}

.title {
  text-align: center;
  margin-bottom: 35px;
  font-size: 1.8rem;
  font-weight: 400;
  font-family: ui-sans-serif, -apple-system, system-ui, Segoe UI, Helvetica, Apple Color Emoji, Arial, sans-serif, Segoe UI Emoji, Segoe UI Symbol;
}

/* Search bar container */
.search-form {
  width: 100%;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bar-color);
  border-radius: 28px;
  padding: 6px;
  height: 56px;
  width: 768px;
  max-width: 100%;
}

/* Icons inside the search bar */
.search-bar .icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bar-alt-color);
  margin-left: 8px;
}

/* Adjust SVG icons to inherit the proper colour */
.search-bar .icon svg {
  width: 20px;
  height: 20px;
  color: var(--icon-color);
}

/* Center the arrow icon for both button and span */
.search-bar .send svg {
  transform: translateX(-3.5px);
}

/* Add margin to send icon */
.search-bar .send {
  margin-right: 5px;
}

/* Button styling for send icon */
.search-bar button.send {
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--bar-alt-color);
  transition: background-color 0.15s ease;
}

/* Text input styling */
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-color);
  font-size: 1rem;
  height: 100%;
  padding: 0 20px;
}

.search-bar input::placeholder {
  color: var(--placeholder-color);
}

.search-bar input:focus {
  outline: none;
}

/* Results container */
.result {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 30px;
  background-color: var(--bar-color);
  border-radius: 12px;
  padding: 20px;
}

.result p {
  margin-bottom: 12px;
}

.link-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Responsive layout for small screens */
@media (max-width: 600px) {
  .link-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  
  .link-wrapper input {
    margin-bottom: 8px;
  }
  
  .button-group {
    display: flex;
    gap: 8px;
  }
  
  .button-group button {
    flex: 1;
    min-height: 44px; /* Better touch target for mobile */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-size: 1rem;
    padding: 12px 16px;
    white-space: nowrap;
    text-align: center;
  }
}

.link-wrapper input {
  flex: 1;
  border: none;
  border-radius: 6px;
  padding: 8px;
  background-color: #212121;
  color: var(--text-color);
  font-size: 0.9rem;
}

.link-wrapper input:focus {
  outline: none;
}

#copyButton, #previewButton {
  padding: 8px 16px;
  background-color: var(--button-bg);
  color: #000000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-size: 0.9rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-height: 32px;
  box-sizing: border-box;
}

#copyButton:hover, #previewButton:hover {
  background-color: var(--button-bg-hover);
}

.hint {
  color: var(--placeholder-color);
  margin-top: 10px;
  font-size: 0.8rem;
  text-align: center;
}

/* Footer text */
.footer {
  position: fixed;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--text-color);
  font-size: 0.8rem;
  opacity: 1;
}

.footer a {
  color: inherit;
  text-decoration: none;
}

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