/* General Body and Font Styles */
body {
  background-color: #111827; /* bg-gray-900 */
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: #E5E7EB; /* text-gray-200 */
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

/* Main Container */
.container {
  width: 100%;
  max-width: 800px;
  padding: 1rem;
}
@media (min-width: 640px) {
  .container { padding: 1.5rem; }
}
@media (min-width: 1024px) {
  .container { padding: 2rem; }
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
}
header h1 {
  font-size: 2.25rem; /* text-4xl */
  font-weight: 800; /* font-extrabold */
  letter-spacing: -0.025em; /* tracking-tight */
}
@media (min-width: 640px) {
  header h1 { font-size: 3rem; } /* sm:text-5xl */
}
.gradient-text {
  background-image: linear-gradient(to right, #6366F1, #8B5CF6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle {
  margin-top: 1rem;
  max-width: 48rem; /* max-w-3xl */
  margin-left: auto;
  margin-right: auto;
  font-size: 1.125rem; /* text-lg */
  color: #9CA3AF; /* text-gray-400 */
}

/* Card layout */
.card {
  background-color: #1F2937; /* bg-gray-800 */
  padding: 1.5rem;
  border-radius: 1rem; /* rounded-2xl */
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); /* shadow-lg */
  border: 1px solid #374151; /* border-gray-700 */
}
.card h2 {
  font-size: 1.25rem; /* text-xl */
  font-weight: 700; /* font-bold */
  color: #F9FAFB; /* text-gray-100 */
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Image Uploader */
.hidden-input {
  display: none;
}
#image-upload-button {
  width: 100%;
  background-color: #1F2937; /* bg-gray-800 */
  border: 2px dashed #4B5563; /* border-gray-600 */
  border-radius: 0.5rem; /* rounded-lg */
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #F9FAFB; /* text-gray-100 */
}
#image-upload-button:hover {
  border-color: #6366F1; /* hover:border-indigo-500 */
  background-color: #374151; /* hover:bg-gray-700 */
}
#image-upload-button .icon {
  width: 3rem; /* h-12 w-12 */
  height: 3rem;
  color: #6B7280; /* text-gray-500 */
}
#image-upload-button span {
  margin-top: 0.5rem;
  font-weight: 500; /* font-medium */
}
.uploader-subtitle {
  margin-top: 0.25rem;
  font-size: 0.75rem; /* text-xs */
  color: #9CA3AF; /* text-gray-400 */
}

/* Controls Section */
.hidden {
  display: none;
}
#controls-wrapper {
  margin-top: 1.5rem;
}
.controls-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.control-group {
  margin-bottom: 1rem;
}
.control-group label {
  display: block;
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  color: #D1D5DB; /* text-gray-300 */
  margin-bottom: 0.25rem;
}
.control-group input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #4B5563; /* border-gray-600 */
  border-radius: 0.375rem; /* rounded-md */
  background-color: #374151; /* bg-gray-700 */
  color: white;
  box-sizing: border-box;
}
.control-group input[type="text"]:focus {
  outline: none;
  border-color: #6366F1;
  box-shadow: 0 0 0 2px #6366F1;
}
.color-picker-wrapper {
  display: flex;
  align-items: center;
}
.color-picker-wrapper input[type="color"] {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.25rem;
  border: 1px solid #4B5563;
  border-radius: 0.375rem;
  background-color: #374151;
  cursor: pointer;
}
.color-picker-wrapper span {
  margin-left: 0.5rem;
  color: #9CA3AF;
}
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 0.5rem;
  background: #4B5563; /* bg-gray-600 */
  border-radius: 0.5rem;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  background: #6366F1;
  border-radius: 50%;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  background: #6366F1;
  border-radius: 50%;
  cursor: pointer;
}

/* Preview & Download Section */
.canvas-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #374151; /* bg-gray-700 */
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #4B5563;
  overflow: hidden;
}
#watermark-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
#canvas-placeholder {
  color: #9CA3AF;
}
#download-wrapper {
  margin-top: 1.5rem;
}
.format-selector {
  display: flex;
  align-items: center;
  justify-content: center;
}
.format-selector h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #D1D5DB;
  margin-right: 1rem;
}
.format-buttons {
  display: flex;
  gap: 0.75rem;
}
.format-btn {
  width: 6rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  background-color: #4B5563; /* bg-gray-600 */
  color: #D1D5DB; /* text-gray-300 */
}
.format-btn:hover {
  background-color: #6B7280; /* hover:bg-gray-500 */
}
.format-btn.active {
  background-color: #4F46E5; /* bg-indigo-600 */
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}
.download-btn {
  margin-top: 1rem;
  width: 100%;
  background-color: #4F46E5; /* bg-indigo-600 */
  color: white;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.download-btn:hover {
  background-color: #4338CA; /* hover:bg-indigo-700 */
  transform: scale(1.02);
}

/* Ad Placeholders */
.ad-placeholder {
  background-color: #1F2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ad-placeholder .ad-content {
  text-align: center;
}
.ad-placeholder p {
  color: #6B7280;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.ad-placeholder ins {
  display: inline-block;
  background-color: #374151;
}

/* Features and Share sections */
.features-and-share-wrapper {
  margin-top: 3rem;
  border-top: 1px solid #1F2937;
}
.section-title {
  font-size: 2.25rem; /* text-4xl */
  font-weight: 700; /* font-bold */
  text-align: center;
  color: white;
  margin-bottom: 2.5rem;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .features-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.feature-card {
  background-color: rgba(31, 41, 55, 0.5);
  border: 1px solid #374151;
  border-radius: 0.75rem; /* rounded-xl */
  padding: 1.5rem;
  height: 100%;
  box-sizing: border-box;
}
.feature-card h3 {
  font-size: 1.25rem; /* text-xl */
  font-weight: 600; /* font-semibold */
  color: #38BDF8; /* text-sky-400 */
  margin-top: 0;
}
.feature-card p {
  margin-top: 0.5rem;
  color: #9CA3AF; /* text-gray-400 */
  font-size: 1rem; /* text-base */
  text-align: left;
}
.share-buttons-section {
  margin-top: 3rem;
}
.share-buttons-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}
.share-btn {
  width: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  color: white;
  font-size: 1rem;
  transition: transform 0.2s ease-in-out;
  cursor: pointer;
}
.share-btn:hover {
  transform: scale(1.05);
}
.share-btn[data-platform="x"], .share-btn[data-platform="threads"] {
  border: 1px solid #4B5563;
}

/* Footer */
footer {
  width: 100%;
  margin-top: 3rem;
  padding: 1.5rem 0;
  text-align: center;
  color: #6B7280; /* text-gray-500 */
  border-top: 1px solid #1F2937; /* border-gray-800 */
}