/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:wght@400;500;600&display=swap');

/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
}

.font-serif {
  font-family: 'EB Garamond', serif;
}

/* Dark mode styles */
.dark {
  color-scheme: dark;
}

/* Utility classes for layout */
.min-h-screen {
  min-height: 100vh;
}

.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.duration-300 {
  transition-duration: 300ms;
}

.duration-500 {
  transition-duration: 500ms;
}

.ease-out {
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

/* Header styles */
.absolute {
  position: absolute;
}

.top-0 {
  top: 0;
}

.left-0 {
  left: 0;
}

.right-0 {
  right: 0;
}

.flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.items-center {
  align-items: center;
}

.items-baseline {
  align-items: baseline;
}

.flex-col {
  flex-direction: column;
}

.p-6 {
  padding: 1.5rem;
}

.p-2 {
  padding: 0.5rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.pb-3 {
  padding-bottom: 0.75rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-4xl {
  font-size: 2.25rem;
  line-height: 2.5rem;
}

.text-6xl {
  font-size: 3.75rem;
  line-height: 1;
}

.italic {
  font-style: italic;
}

.font-light {
  font-weight: 300;
}

.rounded-full {
  border-radius: 9999px;
}

.w-5 {
  width: 1.25rem;
}

.h-5 {
  height: 1.25rem;
}

.w-4 {
  width: 1rem;
}

.h-4 {
  height: 1rem;
}

/* Main content styles */
.max-w-2xl {
  max-width: 42rem;
}

.w-full {
  width: 100%;
}

.space-y-8 > * + * {
  margin-top: 2rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-2 {
  gap: 0.5rem;
}

.relative {
  position: relative;
}

.top-1 {
  top: 0.25rem;
}

/* Transform utilities */
.transition-transform {
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.-translate-y-4 {
  transform: translateY(-1rem);
}

.translate-y-0 {
  transform: translateY(0);
}

/* Input styles */
.border-b {
  border-bottom-width: 1px;
  border-bottom-style: solid;
}

.bg-transparent {
  background-color: transparent;
}

.outline-none {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.text-center {
  text-align: center;
}

/* Fix for input placeholder color */
input::placeholder {
  color: #A8A29D;
  opacity: 1;
}

/* Fix for input focus border */
input:focus {
  border-color: #A8A29D;
  outline: none;
}

/* Button states */
.opacity-50 {
  opacity: 0.5;
}

.cursor-not-allowed {
  cursor: not-allowed;
}

.disabled\:opacity-50:disabled {
  opacity: 0.5;
}

/* Hover states */
.hover\:bg-gray-800:hover {
  background-color: rgb(31 41 55);
}

.hover\:bg-gray-100:hover {
  background-color: rgb(243 244 246);
}

/* Opacity transitions */
.transition-opacity {
  transition-property: opacity;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.opacity-0 {
  opacity: 0;
}

.opacity-100 {
  opacity: 1;
}

/* Animation utilities */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Custom component styles */
.app-container {
  min-height: 100vh;
  transition: color 300ms, background-color 300ms;
}

.app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
}

.app-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 300;
  color: #A8A29D;
}

.theme-toggle {
  padding: 0.5rem;
  border-radius: 9999px;
  transition: background-color 300ms;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.main-content {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content-wrapper {
  width: 100%;
  max-width: 42rem;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.content-wrapper > * + * {
  margin-top: 2rem;
}

.input-section {
  display: flex;
  justify-content: center;
  transition: transform 500ms cubic-bezier(0, 0, 0.2, 1);
}

.input-section.typing {
  transform: translateY(-1rem);
}

.input-container {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-family: 'EB Garamond', serif;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.adjective-input {
  border-bottom: 1px solid #A8A29D;
  transition: color 300ms, background-color 300ms, border-color 300ms;
  background-color: transparent;
  outline: none;
  text-align: center;
  font-size: 2.25rem;
  line-height: 2.5rem;
  font-family: 'EB Garamond', serif;
  padding-bottom: 0.75rem;
  width: 16rem;
  border-top: none;
  border-left: none;
  border-right: none;
}

.search-button {
  padding: 0.5rem;
  transition: color 300ms;
  position: relative;
  top: 0.25rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #A8A29D;
}

.search-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-section {
  transition: opacity 300ms;
}

.result-section.fade {
  opacity: 0;
}

.result-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.suggestion-text {
  font-size: 3.75rem;
  line-height: 1;
  font-family: 'EB Garamond', serif;
}

.refresh-button {
  padding: 0.5rem;
  border-radius: 9999px;
  transition: all 300ms;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.refresh-button:disabled {
  opacity: 0.5;
}

.refresh-button.spinning {
  animation: spin 1s linear infinite;
}

.error-section {
  display: flex;
  justify-content: center;
  animation: shake 0.5s ease-in-out;
}

.error-message {
  font-size: 1.5rem;
  line-height: 2rem;
  font-family: 'EB Garamond', serif;
  color: #EF4444;
}

/* Responsive design */
@media (max-width: 768px) {
  .text-4xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
  
  .text-6xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  
  .adjective-input {
    font-size: 1.875rem;
    line-height: 2.25rem;
    width: 12rem;
  }
  
  .input-container {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
  
  .suggestion-text {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  
  .px-6 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}