.color-match-header,
.color-match-tool {
  background-color: #151718;
}

.color-match-intro {
  margin-bottom: 0;
  line-height: 1.65;
}

.color-match-intro-line {
  display: block;
}

.color-match-launch-banner {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 1.25rem auto 2rem;
  padding: 0.65rem 1.25rem;
  max-width: 36rem;
  border-radius: 9999px;
  border: 1px solid rgba(234, 188, 65, 0.4);
  background: linear-gradient(135deg, rgba(234, 188, 65, 0.14), rgba(234, 188, 65, 0.05));
  color: #eef0f3;
  font-size: 0.95rem;
  line-height: 1.4;
}

.color-match-launch-banner-label {
  font-weight: 600;
  color: #eabc41;
}

.color-match-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
}

.color-match-tool .upload-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .color-match-tool .upload-container {
    grid-template-columns: repeat(3, 1fr);
  }
}

.color-match-tool .image-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: Sora, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #336ced;
  margin: 0 0 0.75rem;
}

.color-match-tool .image-section h2 svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.color-match-tool .dropzone,
.color-match-tool .preview-container {
  position: relative;
  min-height: 220px;
  border: 2px dashed #3a3d42;
  border-radius: 0.75rem;
  background: #1c1f22;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s, background-color 0.2s;
}

.color-match-tool .dropzone:hover,
.color-match-tool .dropzone.highlight {
  border-color: #336ced;
  background: #22262a;
}

.color-match-tool .dropzone.has-image,
.color-match-tool .preview-container.has-image {
  border-style: solid;
  border-color: #3a3d42;
  padding: 0;
}

.color-match-tool .preview-container {
  cursor: zoom-in;
}

.color-match-tool .upload-content {
  text-align: center;
  padding: 1.5rem;
  pointer-events: none;
}

.color-match-tool .upload-icon {
  width: 2rem;
  height: 2rem;
  color: #336ced;
  margin: 0 auto 0.75rem;
  display: block;
}

.color-match-tool .dropzone-text {
  color: #eef0f3;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.color-match-tool .dropzone-subtext {
  color: #9ca3af;
  font-size: 0.85rem;
}

.color-match-tool .preview-container > span {
  color: #9ca3af;
  font-size: 0.95rem;
  padding: 1.5rem;
  text-align: center;
}

.color-match-tool .preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  min-height: 220px;
}

.color-match-tool .result-section .preview-container.has-image {
  border-color: #336ced;
}

.color-match-tool .pexels-trigger {
  display: block;
  margin-top: 0.75rem;
  background: none;
  border: none;
  color: #336ced;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.color-match-tool .pexels-trigger:hover {
  color: #5a8af0;
}

.color-match-tool .options-section {
  margin-top: 2rem;
  padding: 1.5rem;
  border: 1px solid #3a3d42;
  border-radius: 0.75rem;
  background: #1c1f22;
}

.color-match-tool .options-section h3 {
  font-family: Sora, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #eef0f3;
  margin: 0 0 1.25rem;
}

.color-match-tool .option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.color-match-tool .option-row label {
  color: #d1d5db;
  font-size: 0.95rem;
}

.color-match-tool .option-row select {
  min-width: 220px;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #3a3d42;
  background: #151718;
  color: #eef0f3;
  font-size: 0.9rem;
}

.color-match-tool .slider-container {
  margin-top: 0.5rem;
}

.color-match-tool .slider-container label {
  display: block;
  color: #d1d5db;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.color-match-tool .slider {
  width: 100%;
  accent-color: #336ced;
}

.color-match-tool .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.color-match-tool .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.color-match-tool .switch-slider {
  position: absolute;
  inset: 0;
  background: #3a3d42;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}

.color-match-tool .switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.color-match-tool .switch input:checked + .switch-slider {
  background: #336ced;
}

.color-match-tool .switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

.color-match-tool .action-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.color-match-tool .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
}

.color-match-tool .action-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.color-match-tool .action-btn-primary {
  background: #336ced;
  color: #fff;
}

.color-match-tool .action-btn-primary:hover:not(:disabled) {
  background: #2558c7;
}

.color-match-tool .action-btn-secondary {
  background: transparent;
  color: #eef0f3;
  border: 1px solid #4b5563;
}

.color-match-tool .action-btn-secondary:hover:not(:disabled) {
  border-color: #9ca3af;
  background: #22262a;
}

.color-match-tool .action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Modals */
.result-modal,
.pexels-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.result-modal[hidden],
.pexels-modal[hidden] {
  display: none !important;
}

.result-modal-backdrop,
.pexels-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.result-modal-dialog {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  z-index: 1;
}

.result-modal-dialog img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 0.5rem;
  display: block;
}

.pexels-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  min-height: 570px;
  max-height: 90vh;
  overflow-y: auto;
  background: #1c1f22;
  border: 1px solid #3a3d42;
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.pexels-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.pexels-modal-header h3 {
  font-family: Sora, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #eef0f3;
  margin: 0;
}

.pexels-modal-subtitle {
  color: #9ca3af;
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}

.pexels-modal-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.pexels-modal .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.pexels-modal .action-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.pexels-modal .action-btn-primary {
  background: #336ced;
  color: #fff;
}

.pexels-modal .action-btn-primary:hover:not(:disabled) {
  background: #2558c7;
}

.pexels-modal .action-btn-secondary {
  background: transparent;
  color: #eef0f3;
  border: 1px solid #4b5563;
}

.pexels-modal .action-btn-secondary:hover:not(:disabled) {
  border-color: #9ca3af;
  background: #22262a;
}

.pexels-modal .action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pexels-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pexels-search-input {
  flex: 1;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #3a3d42;
  background: #151718;
  color: #eef0f3;
  font-size: 0.95rem;
}

.pexels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .pexels-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.pexels-card {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 0.5rem;
  overflow: hidden;
  text-align: left;
}

.pexels-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.pexels-card-meta {
  display: block;
  font-size: 0.7rem;
  color: #9ca3af;
  padding: 0.35rem 0.25rem;
}

.pexels-status {
  color: #9ca3af;
  font-size: 0.875rem;
  margin: 0.75rem 0 0;
}

.pexels-credit {
  color: #6b7280;
  font-size: 0.8rem;
  margin: 0.75rem 0 0;
}

.pexels-credit a {
  color: #336ced;
  text-decoration: underline;
}

.result-modal-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: #1c1f22;
  border: 1px solid #3a3d42;
  border-radius: 0.375rem;
  color: #eef0f3;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pexels-modal .result-modal-close {
  position: static;
}

body.modal-open {
  overflow: hidden;
}
