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

body {
  font-family: "Inter", Arial, sans-serif;
  background: #151521; 
  color: #f3f4f6;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  min-height: 100vh;
}

/* Title */
h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 20px;
  text-align: center;
}

/* Container for search form and history button */
#searchContainer {
  display: flex;
  justify-content: center; 
  gap: 10px;              
  width: 100%;
  max-width: 700px;
  margin-bottom: 24px;
}

/* Form itself: input + search button */
#searchForm {
  display: flex;
  gap: 10px;  
  flex: 1;     
}

.input-wrapper {
  position: relative;
  flex: 1;
}

#searchInput:-webkit-autofill,
#searchInput:-webkit-autofill:hover,
#searchInput:-webkit-autofill:focus {
  -webkit-text-fill-color: #f9fafb; 
  border: 1px solid #d811b3;   
  box-shadow: 0 0 6px #d811b3; 
  transition: background-color 9999s ease-in-out 0s;
}

/* Input - Simplified focus handling */
#searchInput {
  width: 100%;
  padding: 12px 40px 12px 14px; 
  font-size: 1rem;
  border: 1px solid #374151;
  border-radius: 10px;
  background: #2a2a3b;
  color: #f9fafb;
  outline: none !important; /* Force remove all outlines */
  transition: border 0.2s ease, box-shadow 0.2s ease; 
}

/* Only show custom focus when actively typing */
#searchInput:focus {
  border: 1px solid #d811b3;   
  box-shadow: 0 0 6px #d811b3; 
  outline: none !important;
}

.clear-btn {
  display: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #f87171;
  cursor: pointer;
}

.clear-btn:hover {
  color: #ffffff;
}

/* Buttons - Simplified focus handling */
#searchForm button,
#historyButton {
  padding: 12px 18px;
  font-size: 1rem;
  background: #d811b3;
  color: #ffffff;
  border: 1px solid #374151;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
  outline: none !important; /* Force remove all outlines */
}

/* Hover effect for buttons */
#searchForm button:hover,
#historyButton:hover {
  background: #3f0639;
}

/* Custom focus for buttons only when tabbing */
#searchForm button:focus,
#historyButton:focus {
  background: #3f0639;
  outline: none !important;
}

/* Results card */
#results {
  background: #2a2a3b;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  max-width: 700px;
  width: 100%;
  line-height: 1.6;
  color: #e5e7eb;
}

.error {
  color: #f87171; 
  font-weight: 500;
}

/* History modal */
.history {
  display: none; 
  color: #f9fafb;
  background: #2a2a3b;
  border: 1px solid #374151;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  max-width: 700px;
  width: 100%;
  padding: 20px;
  margin-top: 10px;
  margin-bottom: 10px;
  flex-direction: column;
  gap: 8px;
}