@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(
    135deg,
    #0a0a0a 0%,
    #1a1a2e 25%,
    #16213e 50%,
    #0f3460 75%,
    #0a0a0a 100%
  );
  background-size: 400% 400%;
  animation: gradientAnimation 15s ease infinite;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

@keyframes gradientAnimation {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: radial-gradient(
      ellipse at center,
      rgba(102, 126, 234, 0.1) 0%,
      transparent 50%
    ),
    linear-gradient(45deg, transparent 30%, rgba(118, 75, 162, 0.05) 70%);
  animation: backgroundPulse 8s ease-in-out infinite;
}

@keyframes backgroundPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.05);
  }
}

.floating-shapes {
  position: fixed;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  animation: float 8s ease-in-out infinite;
  backdrop-filter: blur(2px);
}

.shape:nth-child(1) {
  width: 80px;
  height: 80px;
  top: 10%;
  left: 15%;
  animation-delay: 0s;
}
.shape:nth-child(2) {
  width: 60px;
  height: 60px;
  top: 70%;
  left: 85%;
  animation-delay: 2s;
}
.shape:nth-child(3) {
  width: 100px;
  height: 100px;
  top: 85%;
  left: 10%;
  animation-delay: 4s;
}
.shape:nth-child(4) {
  width: 40px;
  height: 40px;
  top: 30%;
  left: 70%;
  animation-delay: 1s;
}
.shape:nth-child(5) {
  width: 120px;
  height: 120px;
  top: 5%;
  left: 75%;
  animation-delay: 3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg) scale(1);
    opacity: 0.3;
  }
  33% {
    transform: translateY(-30px) rotate(120deg) scale(1.1);
    opacity: 0.6;
  }
  66% {
    transform: translateY(15px) rotate(240deg) scale(0.9);
    opacity: 0.4;
  }
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
}

.glass-panel:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.25);
}

.panel-title {
  color: #ffffff;
  margin-bottom: 20px;
  font-size: 1.3em;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
}

h1 {
  text-align: center;
  color: #ffffff;
  font-size: 2.2em;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
  animation: titleGlow 3s ease-in-out infinite alternate;
  line-height: 1.2;
}

@keyframes titleGlow {
  from {
    filter: brightness(1);
    text-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
  }
  to {
    filter: brightness(1.2);
    text-shadow: 0 0 40px rgba(240, 147, 251, 0.6);
  }
}

.subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
  font-size: 1.1em;
  font-weight: 300;
  line-height: 1.4;
}

.layout-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

.bottom-section {
  width: 100%;
  margin-top: 16px;
}

.color-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.color-group {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.4s ease;
  position: relative;
  backdrop-filter: blur(10px);
}

.color-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 126, 234, 0.5),
    transparent
  );
  border-radius: 16px 16px 0 0;
}

.color-group:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.color-group h3 {
  color: #ffffff;
  margin-bottom: 16px;
  font-size: 1.2em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-input {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.color-input label {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9em;
  min-width: 120px;
  font-weight: 500;
  flex-shrink: 0;
}

.color-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 48px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: transparent;
  flex-shrink: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 10px;
}

.color-picker:hover {
  transform: scale(1.1);
  border-color: rgba(102, 126, 234, 0.8);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.color-picker:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

.color-value {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #ffffff;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.85em;
  min-width: 80px;
  text-align: center;
  font-weight: 500;
  backdrop-filter: blur(10px);
  flex: 1;
  min-width: 0;
}

.preview-section {
  position: static;
}

.phone-mockup {
  background: linear-gradient(
    145deg,
    rgba(0, 0, 0, 0.9),
    rgba(20, 20, 20, 0.8)
  );
  border-radius: 30px;
  padding: 20px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(15px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  max-width: 360px;
  margin: 0 auto;
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.phone-screen {
  background: linear-gradient(145deg, #000000, #111111);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  min-height: 480px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.preset-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  border: 2px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.preset-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(102, 126, 234, 0.6),
    transparent
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.preset-card:hover::before {
  transform: translateX(100%);
}

.preset-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(102, 126, 234, 0.4);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.preset-card h4 {
  color: #ffffff;
  margin-bottom: 12px;
  font-size: 1.1em;
  font-weight: 600;
}

.color-preview {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: transform 0.2s ease;
}

.preset-card:hover .color-dot {
  transform: scale(1.1);
}

.output-section {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.url-output {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  color: #ffffff;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.8em;
  word-break: break-all;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 16px;
  line-height: 1.4;
  backdrop-filter: blur(10px);
}

.url-output::-webkit-scrollbar {
  width: 4px;
}

.url-output::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.url-output::-webkit-scrollbar-thumb {
  background: rgba(102, 126, 234, 0.6);
  border-radius: 2px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  padding: 16px 24px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  backdrop-filter: blur(15px);
  font-size: 0.9em;
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 140px;
  touch-action: manipulation;
}

.btn::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.6s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0px);
}

.nav-bar,
.tab-bar,
.table-view {
  border-radius: 12px;
  transition: all 0.3s ease;
}

.nav-bar {
  height: 60px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.nav-title {
  font-weight: 600;
  font-size: 1.1em;
}

.tab-bar {
  height: 50px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.tab-item {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9em;
  transition: all 0.3s ease;
  font-weight: 500;
}

.table-view {
  overflow: hidden;
  margin-bottom: 16px;
}

.table-cell {
  padding: 16px;
  border-bottom: 1px solid;
  font-size: 0.95em;
  transition: all 0.3s ease;
  font-weight: 500;
}

@media (min-width: 1200px) {
  .main-content {
    grid-template-columns: 1fr 420px;
    gap: 30px;
  }

  .preview-section {
    position: sticky;
    top: 20px;
  }

  .color-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
  
  .container {
    padding: 20px;
  }

  .glass-panel {
    padding: 35px;
    margin-bottom: 30px;
    border-radius: 24px;
  }

  h1 {
    font-size: 3.2em;
    margin-bottom: 15px;
  }

  .subtitle {
    margin-bottom: 50px;
    font-size: 1.2em;
  }

  .shape:nth-child(1) {
    width: 120px;
    height: 120px;
  }
  .shape:nth-child(2) {
    width: 80px;
    height: 80px;
  }
  .shape:nth-child(3) {
    width: 150px;
    height: 150px;
  }
  .shape:nth-child(4) {
    width: 60px;
    height: 60px;
  }
  .shape:nth-child(5) {
    width: 200px;
    height: 200px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .presets {
    grid-template-columns: repeat(2, 1fr);
  }

  .color-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .action-buttons {
    justify-content: center;
  }

  .btn {
    flex: 0 1 auto;
  }
}

@media (max-width: 767px) {
  .container {
    padding: 12px;
  }

  .glass-panel {
    padding: 20px;
    margin-bottom: 16px;
    border-radius: 16px;
  }

  h1 {
    font-size: 2em;
    margin-bottom: 10px;
  }

  .subtitle {
    font-size: 1em;
    margin-bottom: 24px;
  }

  .panel-title {
    font-size: 1.2em;
    margin-bottom: 16px;
  }

  .presets {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .preset-card {
    padding: 16px;
  }

  .color-group {
    padding: 16px;
  }

  .color-input {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .color-input label {
    min-width: auto;
    margin-bottom: 4px;
  }

  .color-picker {
    width: 100%;
    max-width: 200px;
    align-self: flex-start;
  }

  .action-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    flex: none;
    width: 100%;
    min-width: auto;
    padding: 18px 24px;
    font-size: 1em;
  }

  .phone-mockup {
    padding: 16px;
    border-radius: 24px;
  }

  .phone-screen {
    padding: 16px;
    min-height: 400px;
    border-radius: 16px;
  }

  .nav-bar {
    height: 50px;
    padding: 0 12px;
  }

  .nav-title {
    font-size: 1em;
  }

  .tab-bar {
    height: 44px;
  }

  .tab-item {
    padding: 6px 12px;
    font-size: 0.85em;
  }

  .table-cell {
    padding: 14px 12px;
    font-size: 0.9em;
  }

  .url-output {
    font-size: 0.75em;
    padding: 12px;
    max-height: 120px;
  }
}

@media (max-width: 375px) {
  h1 {
    font-size: 1.8em;
  }

  .glass-panel {
    padding: 16px;
  }

  .phone-mockup {
    padding: 12px;
  }

  .phone-screen {
    padding: 12px;
    min-height: 350px;
  }

  .btn {
    padding: 16px 20px;
    font-size: 0.9em;
  }
}

@media (hover: none) and (pointer: coarse) {
  .glass-panel:hover,
  .color-group:hover,
  .preset-card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .color-picker:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
  }
}

@media (max-width: 767px) {
  .color-picker,
  .btn,
  .preset-card {
    min-height: 44px;
  }
  
  .preset-card {
    min-height: auto;
    padding: 20px;
  }
}