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

:root {
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --success: #10b981;
  --error: #ef4444;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-dark);
  position: relative;
  overflow-x: hidden;
}

/* Animated background elements */
body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 500px;
  height: 500px;
  background: white;
  top: -250px;
  right: -250px;
  animation: float 20s ease-in-out infinite;
}

body::after {
  width: 400px;
  height: 400px;
  background: white;
  bottom: -200px;
  left: -200px;
  animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(30px, 30px) rotate(180deg);
  }
}

/* Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s, visibility 0.5s;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-ring {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  color: white;
  margin-top: 20px;
  font-size: 1.1rem;
  font-weight: 500;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1rem 2rem;
  position: relative;
  z-index: 10;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 700;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

/* Main Content */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.container {
  background: white;
  padding: 3rem;
  border-radius: 24px;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.6s ease-out;
  position: relative;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.title-section {
  text-align: center;
  margin-bottom: 2.5rem;
}

.title-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: inline-block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.title-section h1 {
  font-size: 2.25rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
  font-weight: 800;
}

.title-section p {
  color: var(--text-light);
  font-size: 1.1rem;
  font-weight: 400;
}

/* Input Group */
.input-group {
  margin-bottom: 2rem;
  position: relative;
}

.input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1.2rem;
  pointer-events: none;
  transition: color 0.3s;
}

input {
  width: 100%;
  padding: 18px 20px 18px 52px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-light);
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

input:focus + .input-icon {
  color: var(--primary);
}

button {
  width: 100%;
  padding: 18px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

button::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;
}

button:hover:not(:disabled)::before {
  left: 100%;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading State */
.loading {
  color: transparent;
}

.loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Result Box */
.result {
  margin-top: 2rem;
  padding: 0;
  display: none;
  animation: fadeIn 0.5s ease;
}

.result.show {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--success);
  margin-bottom: 16px;
  font-size: 1rem;
}

.success-icon {
  width: 24px;
  height: 24px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0) rotate(-180deg);
  }
  to {
    transform: scale(1) rotate(0deg);
  }
}

.link-wrapper {
  display: flex;
  gap: 12px;
  align-items: stretch;
  padding: 16px;
  background: var(--bg-light);
  border: 2px solid var(--border);
  border-radius: 12px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.link-wrapper:hover {
  border-color: var(--primary);
  background: white;
}

.link-content {
  flex: 1;
  min-width: 0;
}

.link-label {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.link-wrapper a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  word-break: break-all;
  display: block;
  font-size: 1.05rem;
}

.link-wrapper a:hover {
  text-decoration: underline;
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  padding: 12px;
  background: white;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}

.icon-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.05);
}

.icon-btn.copied {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.qr-section {
  background: var(--bg-light);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.qr-section p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 16px;
  font-weight: 500;
}

.qr-code {
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  max-width: 180px;
  height: auto;
  border: 4px solid white;
}

/* Stats Section */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.stat-item {
  background: white;
  padding: 12px;
  border-radius: 10px;
  border: 2px solid var(--border);
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Error Message */
.error {
  color: var(--error);
  background: #fef2f2;
  padding: 14px 18px;
  border-radius: 10px;
  border-left: 4px solid var(--error);
  margin-top: 1rem;
  display: none;
  animation: shake 0.5s ease;
  font-size: 0.95rem;
  font-weight: 500;
}

.error.show {
  display: flex;
  align-items: center;
  gap: 10px;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}

/* Redirect Message */
.redirect-msg {
  display: none;
  text-align: center;
  color: white;
}

.redirect-msg.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.redirect-msg h1 {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

.redirect-msg p {
  font-size: 1.3rem;
  opacity: 0.95;
  font-weight: 500;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Footer */
footer {
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  padding: 2rem;
  color: white;
  text-align: center;
  position: relative;
  z-index: 10;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content p {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.footer-content a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s ease;
  border-bottom: 2px solid transparent;
}

.footer-content a:hover {
  opacity: 1;
  border-bottom-color: white;
}

.heart {
  color: #ff6b6b;
  display: inline-block;
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0%,
  100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.2);
  }
  50% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 1rem 1.5rem;
  }

  .container {
    padding: 2rem 1.5rem;
  }

  .title-section h1 {
    font-size: 1.75rem;
  }

  .title-icon {
    font-size: 3rem;
  }

  .link-wrapper {
    flex-direction: column;
  }

  .action-buttons {
    width: 100%;
  }

  .icon-btn {
    flex: 1;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  body::before,
  body::after {
    display: none;
  }
}

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  font-size: 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
