/* ### General Layout ### */
.scc-colorizer-ui {
  background: #f5f7fa;
  max-width: 700px;
  margin: 30px auto;
  border-radius: 18px;
  box-shadow: 0 6px 28px #b3bad833;
  padding: 20px;
}

/* Flexbox fixes for responsiveness */
.scc-toolbar {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.scc-toolbar > div {
  flex: 1 1 100%; /* Default to full-width on smaller screens */
  margin-bottom: 12px;
}

.scc-dropdown {
  display: block;
  font-size: 1.1em;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  width: 100%; /* Full width for mobile */
}

/* Court Preview Box */
.scc-court-preview {
  width: 100%; /* Full width scaling */
  max-width: 960px; /* Contain on large screens */
  margin: 0 auto;
  position: relative;
  height: auto; /* Let height adjust proportionally */
  background: #eaf0f7;
  border-radius: 14px;
  box-shadow: 0 1px 10px #b3bad877;
}

/* Responsive SVG inside court preview */
.scc-court-preview svg {
  max-width: 100%;
  height: auto; /* Keep aspect ratio */
  display: block;
  margin: 0 auto;
  border-radius: 10px;
}

/* ### Zone Palettes ### */
.scc-palettes {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Each palette row style */
.scc-zone-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* For wrapping on smaller screens */
  gap: 10px;
}

.scc-zone-title {
  font-weight: 700;
  font-size: 1em;
  color: #2e425a;
  flex: 1 1 100px; /* Set responsive width */
  margin-right: 10px;
}

/* Color swatches (responsive grid) */
.scc-color-swatch {
  appearance: none;
  width: 30px;
  height: 30px;
  border: 2px solid #eee;
  margin-right: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.14s, transform 0.12s ease;
}

.scc-color-swatch:hover {
  transform: scale(1.1); /* Slight hover scaling */
  border-color: #2563ff;
  box-shadow: 0 0 3px 3px #dceafd;
}

/* ### Logo Upload ### */
.scc-file {
  max-width: 300px;
  width: 100%; /* Fully responsive */
  padding: 6px;
}

/* ### Download Button ### */
.scc-download-btn {
  cursor: pointer;
  background: #4e98f7;
  color: white;
  font-size: 16px;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  transition: box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px #b3d1f977;
}

.scc-download-btn:hover {
  background: #2b78db;
  box-shadow: 0 6px 14px #9fbbe477;
}

/* ### Modal Responsiveness ### */
.scc-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.65);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.scc-modal-content {
  background: white;
  border-radius: 15px;
  padding: 20px;
  width: 90%; /* Adjust for small screens */
  max-width: 400px; /* Contain on larger ones */
  position: relative;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

/* Modal Close Button */
.scc-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
}

.scc-modal-btn {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  background: #3887f7;
  color: white;
  border: none;
  border-radius: 7px;
  margin-top: 15px;
  cursor: pointer;
  transition: background 0.2s;
}

.scc-modal-btn:hover {
  background: #2563f3;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ### Media Queries ### */
@media (max-width: 768px) { 
  .scc-toolbar {
    flex-direction: column; /* Stack the toolbar items */
    gap: 20px;
  }
  .scc-toolbar > div {
    flex: 1 1 auto; /* Full width on mobile */
  }
  .scc-zone-title {
    width: 100%; /* Take full row width */
  }
  .scc-court-preview {
    max-width: 100%; /* Full screen width */
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .scc-color-swatch {
    width: 24px;
    height: 24px;
    margin-right: 4px;
  }
  .scc-download-btn {
    font-size: 14px;
    padding: 8px 16px;
  }
  .scc-modal-content {
    width: 100%;
    padding: 15px;
  }
  .scc-modal-btn {
    font-size: 13px;
  }
}