/* Custom styles to complement Tailwind CSS */

/* Ensure Tailwind animations work properly */
.animate-gradient-shift {
  background-size: 300% 300%;
}

/* Enhanced error message styling */
.error-message {
  transition: all 0.3s ease;
}

.error-message:empty {
  opacity: 0;
  padding: 0;
  border: none;
  background: none;
}

/* Custom hover effects for value elements */
.value {
  position: relative;
  overflow: hidden;
}

.value::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 126, 234, 0.1),
    transparent
  );
  transition: left 0.5s;
}

.value:hover::before {
  left: 100%;
}

/* Ensure proper text contrast for bright colors */
.text-contrast-auto {
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

/* Additional custom utility classes for enhanced UI */
.glass-effect {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.text-shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.shadow-glow {
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

/* Footer enhancements */
footer {
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
}

/* GitHub icon hover effect */
.github-link:hover svg {
  transform: rotate(5deg);
}

/* Pulsing heart animation */
@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.heart-pulse {
  animation: heartbeat 1.5s ease-in-out infinite;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 30px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  overflow: hidden;
  position: relative;
  animation: containerFloat 6s ease-in-out infinite;
}

@keyframes containerFloat {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 300% 300%;
  animation: gradientShift 8s ease infinite;
  color: white;
  text-align: center;
  padding: 50px 20px;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.2) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 70% 70%,
      rgba(255, 255, 255, 0.1) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.header h1 {
  font-size: 3em;
  margin-bottom: 15px;
  font-weight: 700;
  background: linear-gradient(45deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header p {
  font-size: 1.2em;
  opacity: 0.95;
  position: relative;
  z-index: 1;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.input-section {
  padding: 50px 40px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  position: relative;
}

.input-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 126, 234, 0.3),
    transparent
  );
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 25px;
  align-items: center;
}

.input-group label {
  font-size: 1.3em;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.5px;
}

#colorInput {
  width: 100%;
  max-width: 350px;
  padding: 20px 25px;
  font-size: 1.2em;
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Courier New", monospace;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
}

#colorInput:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1),
    0 8px 30px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

#colorInput::placeholder {
  color: #94a3b8;
  font-style: italic;
}

#showColorBtn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 18px 40px;
  font-size: 1.1em;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

#showColorBtn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

#showColorBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

#showColorBtn:hover::before {
  left: 100%;
}

#showColorBtn:active {
  transform: translateY(-1px);
}

.error-message {
  color: #ef4444;
  font-size: 1em;
  text-align: center;
  margin-top: 15px;
  min-height: 25px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  transition: all 0.3s ease;
}

.color-display {
  padding: 50px 40px;
  display: none;
  background: white;
}

.color-display.show {
  display: block;
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.color-preview {
  width: 100%;
  height: 250px;
  border-radius: 25px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.color-preview::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.preview-text {
  font-size: 1.8em;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  color: white;
  position: relative;
  z-index: 1;
  letter-spacing: 1px;
}

.color-info {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 20px;
  padding: 35px;
  display: grid;
  gap: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  transition: all 0.3s ease;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item:hover {
  transform: translateX(5px);
}

.label {
  font-weight: 700;
  color: #334155;
  font-size: 1.2em;
  letter-spacing: 0.5px;
}

.value {
  font-family: "Courier New", monospace;
  font-size: 1.1em;
  color: #1e293b;
  background: white;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.5);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.value::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 126, 234, 0.1),
    transparent
  );
  transition: left 0.5s;
}

.value:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.value:hover::before {
  left: 100%;
}

.preset-colors {
  padding: 50px 40px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  position: relative;
}

.preset-colors::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 126, 234, 0.3),
    transparent
  );
}

.preset-colors h3 {
  text-align: center;
  margin-bottom: 40px;
  color: #334155;
  font-size: 1.8em;
  font-weight: 700;
  letter-spacing: 0.5px;
  position: relative;
}

.preset-colors h3::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 2px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.preset-color {
  height: 100px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.preset-color::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.preset-color:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.preset-color:hover::before {
  left: 100%;
}

.preset-color:active {
  transform: translateY(-4px) scale(1.01);
}

.preset-color span {
  color: white;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
  font-family: "Courier New", monospace;
  font-size: 1em;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    margin: 0;
    border-radius: 25px;
  }

  .header {
    padding: 40px 20px;
  }

  .header h1 {
    font-size: 2.2em;
  }

  .header p {
    font-size: 1.1em;
  }

  .input-section,
  .color-display,
  .preset-colors {
    padding: 40px 25px;
  }

  .color-preview {
    height: 200px;
    border-radius: 20px;
  }

  .preview-text {
    font-size: 1.5em;
  }

  .preset-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
  }

  .preset-color {
    height: 80px;
    border-radius: 15px;
  }

  .preset-color span {
    font-size: 0.9em;
  }

  .color-info {
    padding: 25px;
  }

  .info-item {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 15px 0;
  }

  .value {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.8em;
  }

  .preset-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .preset-color {
    height: 70px;
  }

  .preset-color span {
    font-size: 0.8em;
  }
}
