:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --input-bg: #f5f5f5;
  --input-border: #cccccc;
  --input-text: #333333;
  --placeholder-color: #999999;
  --focus-ring: #007bff;
  --icon-color: #666666;
  --art-bg: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --input-bg: #2d2d2d;
    --input-border: #555555;
    --input-text: #e0e0e0;
    --placeholder-color: #aaaaaa;
    --focus-ring: #4da3ff;
    --icon-color: #cccccc;
    --art-bg: #252525;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  padding: 20px;
}

.search-container {
  width: 100%;
  max-width: 800px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -60px;
}

.search-image {
  margin-bottom: 20px;
  max-width: 200px;
  width: auto;
  height: auto;
}

.search-form {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  min-width: 0;
  position: relative;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 16px 12px 45px;
  font-size: 16px;
  background-color: var(--input-bg);
  border: 2px solid var(--input-border);
  border-radius: 8px;
  color: var(--input-text);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input::placeholder {
  color: var(--placeholder-color);
}

.search-input:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  fill: var(--icon-color);
  pointer-events: none;
}

.locale-picker {
  position: relative;
  flex: 0 0 auto;
}

.search-button {
  flex: 0 0 auto;
  padding: 12px 24px;
  font-size: 16px;
  background-color: var(--focus-ring);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.search-button:hover {
  opacity: 0.9;
}

.search-button:focus {
  outline: 2px solid var(--input-border);
  outline-offset: 2px;
}

.locale-button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #2b2b2b;
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.locale-dropdown {
  position: absolute;
  top: 52px;
  right: 0;
  background: #1f1f1f;
  border-radius: 12px;
  padding: 6px;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  z-index: 20;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.locale-dropdown.show {
  display: grid;
}

.locale-item {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: #333;
  color: white;
  font-size: 20px;
}

.locale-item:hover {
  background: #444;
}

.misc-text {
  font-size: 14px;
  color: var(--placeholder-color);
  position: fixed;
  bottom: 0;
  right: 0;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: right;
  gap: 4px;
}

a {
  color: #97c9ff;
  text-decoration: underline dashed;
}

b {
  color: #97c9ff;
  text-decoration: underline;
}

.art-result {
  margin-top: 20px;
  width: 100%;
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
}

.art-result.show {
  display: flex;
}

.art-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 250px;
}

.art-image {
  width: 100%;
  max-height: 400px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background-color: var(--art-bg);
}

.art-name {
  margin-top: 15px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}

.art-type {
  font-size: 11px;
  font-weight: 600;
}

.art-link {
  margin-top: 10px;
  color: var(--focus-ring);
  text-decoration: none;
  font-size: 14px;
}

.art-link:hover {
  text-decoration: underline;
}

.error-message {
  margin-top: 15px;
  color: #dc3545;
  font-size: 14px;
  text-align: center;
}

.loading {
  margin-top: 15px;
  font-size: 14px;
  color: var(--placeholder-color);
}

.suggestions-list {
  margin-top: 10px;
}

.suggestion-link {
  display: block;
  color: var(--focus-ring);
  text-decoration: underline;
  cursor: pointer;
  padding: 5px 0;
  font-size: 14px;
}

.suggestion-link:hover {
  text-decoration: none;
  opacity: 0.8;
}

@media (max-width: 600px) {
  .search-container {
    padding: 12px;
    margin-top: -30px;
  }

  .search-form {
    gap: 8px;
  }

  .search-input {
    padding: 12px 12px 12px 40px;
    font-size: 16px;
  }

  .search-button {
    padding: 12px 14px;
    font-size: 14px;
  }

  .locale-button {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .locale-dropdown {
    right: 0;
    top: 46px;
  }
}
