* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --success: #10b981;
  --error: #ef4444;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --border: #334155;
  --glow-primary: rgba(99, 102, 241, 0.4);
  --glow-success: rgba(16, 185, 129, 0.4);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* Background Effects */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: var(--primary);
  top: -200px;
  left: -200px;
  animation: float 20s ease-in-out infinite;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: #8b5cf6;
  bottom: -150px;
  right: -150px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(50px, 30px);
  }
}

/* Main Container */
.container {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  padding: 40px;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  margin: 20px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 40px var(--glow-primary);
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 10px 40px var(--glow-primary);
  }
  50% {
    box-shadow: 0 10px 60px var(--glow-primary), 0 0 80px var(--glow-primary);
  }
}

.logo svg {
  color: white;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* Converter Box */
.converter-box {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 16px 50px 16px 16px;
  background: var(--bg-dark);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s ease;
}

.input-wrapper input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--glow-primary);
}

.input-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

/* Buttons */
.convert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px var(--glow-primary);
}

.convert-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow-primary);
}

.convert-btn:active {
  transform: translateY(0);
}

/* Result Box */
.result-box {
  margin-top: 24px;
  padding: 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.result-content {
  display: flex;
  gap: 10px;
}

.result-content input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'SF Mono', Monaco, monospace;
  outline: none;
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--success);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  background: #059669;
  transform: scale(1.02);
}

.copy-btn:active {
  transform: scale(0.98);
}

.copy-btn.copied {
  background: var(--success);
}

/* Hidden */
.hidden {
  display: none !important;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: 12px;
  color: var(--success);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  animation: toastIn 0.3s ease;
}

.toast.error {
  border-color: var(--error);
  color: var(--error);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.toast.show {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
}

/* Error State */
.input-wrapper.error input {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2);
}

/* Responsive */
@media (max-width: 540px) {
  .container {
    padding: 30px 24px;
    margin: 16px;
  }

  .header h1 {
    font-size: 24px;
  }

  .logo {
    width: 64px;
    height: 64px;
  }

  .logo svg {
    width: 32px;
    height: 32px;
  }

  .result-content {
    flex-direction: column;
  }

  .copy-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 380px) {
  .container {
    padding: 24px 20px;
  }

  .header h1 {
    font-size: 22px;
  }

  .subtitle {
    font-size: 13px;
  }
}
