:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --light-bg: #f8fafc;
  --dark-bg: #0f172a;
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #1e293b;
  position: relative;
  padding: 60px 20px 100px;
  transition: all 0.3s ease;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 119, 153, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(138, 180, 248, 0.3) 0%, transparent 50%);
  animation: gradientShift 15s ease infinite;
  pointer-events: none;
  z-index: 0;
}

body.dark {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #e2e8f0;
}

body.dark::before {
  background: 
    radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Floating Particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: float 20s infinite ease-in-out;
}

body.dark .particle {
  background: rgba(99, 102, 241, 0.4);
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(100px);
    opacity: 0;
  }
}

/* Stats Badge */
.stats-badge {
  position: fixed;
  top: 24px;
  left: 24px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #6366f1;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  animation: slideInLeft 0.6s ease;
}

body.dark .stats-badge {
  background: rgba(30, 41, 59, 0.9);
  color: #a78bfa;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Theme Toggle */
.toggle-dark {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-size: 22px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body:not(.dark) .toggle-dark {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fbbf24;
}

body.dark .toggle-dark {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #1e293b;
}

.toggle-dark:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

/* Container */
.container {
  max-width: 680px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 32px;
  padding: 40px 44px 44px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  position: relative;
  z-index: 1;
  animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark .container {
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

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

/* Logo */
.logo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: white;
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4);
  animation: pulse 2s ease-in-out infinite;
  position: relative;
}

.logo-icon::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 24px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  z-index: -1;
  opacity: 0.5;
  filter: blur(12px);
}

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

h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

body.dark h1 {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  text-align: center;
  color: #64748b;
  font-size: 14px;
  margin-bottom: 28px;
  line-height: 1.5;
}

body.dark .subtitle {
  color: #94a3b8;
}

/* Input */
.input-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #6366f1;
  font-size: 16px;
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

body.dark .input-icon {
  color: #8b5cf6;
}

#longUrl {
  width: 100%;
  padding: 16px 52px 16px 20px;
  border-radius: 16px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
  font-family: inherit;
}

body.dark #longUrl {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(139, 92, 246, 0.3);
  color: #e2e8f0;
}

#longUrl:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 1);
}

body.dark #longUrl:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
  background: rgba(30, 41, 59, 0.9);
}

#longUrl.error {
  border-color: #ef4444;
  animation: shake 0.4s;
}

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

.clear-input-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(100, 116, 139, 0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #64748b;
  line-height: 1;
}

.clear-input-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  transform: translateY(-50%) scale(1.1);
}

/* URL Preview */
.url-preview {
  background: rgba(248, 250, 252, 0.6);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
  border: 1px dashed rgba(99, 102, 241, 0.3);
  display: none;
  animation: slideDown 0.3s ease;
}

body.dark .url-preview {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(139, 92, 246, 0.3);
}

.url-preview.show {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 100px;
  }
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6366f1;
  font-weight: 600;
  margin-bottom: 8px;
}

body.dark .preview-header {
  color: #a78bfa;
}

.preview-content {
  font-size: 13px;
  color: #64748b;
  word-break: break-all;
}

/* Buttons */
.button-group {
  margin-top: 0;
}

.btn {
  position: relative;
  overflow: hidden;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 32px;
  border-radius: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline-secondary {
  background: transparent;
  border: 2px solid #6366f1;
  color: #6366f1;
  padding: 12px 24px;
}

body.dark .btn-outline-secondary {
  border-color: #8b5cf6;
  color: #a78bfa;
}

.btn-outline-secondary:hover {
  background: #6366f1;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

body.dark .btn-outline-secondary:hover {
  background: #8b5cf6;
}

/* Result Box */
#resultBox, #historyBox {
  margin-top: 24px;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  display: none;
  animation: slideIn 0.4s ease;
}

body.dark #resultBox,
body.dark #historyBox {
  background: rgba(30, 41, 59, 0.6);
}

#resultBox.show,
#historyBox.show {
  display: block;
}

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

/* Success Animation */
.success-animation {
  display: none;
  justify-content: center;
  margin-bottom: 16px;
}

.success-animation.show {
  display: flex;
}

.checkmark-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
}

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

#shortUrlBox {
  background: linear-gradient(135deg, #f0fdf4 0%, #dbeafe 100%);
  padding: 18px 20px;
  border-radius: 16px;
  border: 2px solid rgba(16, 185, 129, 0.2);
  margin-bottom: 20px;
  word-break: break-word;
  position: relative;
  overflow: hidden;
}

body.dark #shortUrlBox {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.3) 0%, rgba(30, 58, 138, 0.3) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

#shortUrlBox::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 2s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

/* QR Code */
#qrCode {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

#qrCode canvas {
  border-radius: 16px;
  padding: 16px;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  animation: zoomIn 0.5s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* History */
#historyBox h3 {
  font-size: 22px;
  margin-bottom: 20px;
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.dark #historyBox h3 {
  color: #a78bfa;
}

#historyList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#historyList li {
  background: rgba(255, 255, 255, 0.7);
  padding: 16px 18px;
  margin-bottom: 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  border: 1px solid rgba(99, 102, 241, 0.1);
  animation: fadeInRight 0.4s ease;
}

body.dark #historyList li {
  background: rgba(51, 65, 85, 0.4);
  border-color: rgba(139, 92, 246, 0.2);
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#historyList li:hover {
  transform: translateX(6px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.3);
}

#historyList li a {
  color: #6366f1;
  text-decoration: none;
  flex: 1;
  word-break: break-word;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.dark #historyList li a {
  color: #a78bfa;
}

#historyList li a:hover {
  text-decoration: underline;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-history-btn {
  background: transparent;
  border: none;
  color: #6366f1;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dark .copy-history-btn {
  color: #a78bfa;
}

.copy-history-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: scale(1.15);
}

.delete-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 16px;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.15) rotate(10deg);
}

.clear-history-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 10px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.clear-history-btn:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* Toast */
#appToast {
  min-width: 300px;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  z-index: 10000;
  animation: slideInRight 0.4s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

#appToast .toast-body {
  font-weight: 600;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 640px) {
  body {
    padding: 32px 16px 80px;
  }
  
  .container {
    padding: 28px 20px;
    border-radius: 24px;
  }
  
  .logo-icon {
    width: 60px;
    height: 60px;
    font-size: 26px;
    border-radius: 18px;
  }
  
  h1 {
    font-size: 26px;
  }
  
  .subtitle {
    font-size: 13px;
    margin-bottom: 24px;
  }
  
  .stats-badge {
    left: 16px;
    top: 16px;
    padding: 10px 16px;
    font-size: 13px;
  }
  
  .toggle-dark {
    width: 48px;
    height: 48px;
    top: 16px;
    right: 16px;
    font-size: 20px;
  }
  
  #longUrl {
    padding: 14px 48px 14px 46px;
    font-size: 13px;
  }
  
  .btn {
    padding: 13px 26px;
    font-size: 14px;
  }
  
  #resultBox, #historyBox {
    padding: 20px;
    margin-top: 20px;
  }
  
  .checkmark-circle {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }
  
  #historyList li {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  #historyBox h3 {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: 20px;
  }
}
  --primary-dark: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --light-bg: #f8fafc;
  --dark-bg: #0f172a;
}

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

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #1e293b;
  position: relative;
  padding: 60px 20px 100px;
  transition: all 0.3s ease;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 119, 153, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(138, 180, 248, 0.3) 0%, transparent 50%);
  animation: gradientShift 15s ease infinite;
  pointer-events: none;
  z-index: 0;
}

body.dark {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #e2e8f0;
}

body.dark::before {
  background: 
    radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Theme Toggle */
.toggle-dark {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-size: 22px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body:not(.dark) .toggle-dark {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fbbf24;
}

body.dark .toggle-dark {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #1e293b;
}

.toggle-dark:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

/* Container */
.container {
  max-width: 680px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  position: relative;
  z-index: 1;
  animation: fadeInScale 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark .container {
  background: rgba(15, 23, 42, 0.85);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

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

h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

body.dark h1 {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Input */
.input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

#longUrl {
  width: 100%;
  padding: 16px 20px;
  border-radius: 16px;
  border: 2px solid rgba(99, 102, 241, 0.2);
  font-size: 15px;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  font-family: inherit;
}

body.dark #longUrl {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(139, 92, 246, 0.3);
  color: #e2e8f0;
}

#longUrl:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 1);
}

body.dark #longUrl:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
  background: rgba(30, 41, 59, 0.9);
}

#longUrl.error {
  border-color: #ef4444;
  animation: shake 0.4s;
}

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

/* Buttons */
.button-group {
  margin-top: 12px;
}

.btn {
  position: relative;
  overflow: hidden;
  font-weight: 600;
  font-size: 15px;
  padding: 14px 32px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline-secondary {
  background: transparent;
  border: 2px solid #6366f1;
  color: #6366f1;
  padding: 12px 24px;
}

body.dark .btn-outline-secondary {
  border-color: #8b5cf6;
  color: #a78bfa;
}

.btn-outline-secondary:hover {
  background: #6366f1;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

body.dark .btn-outline-secondary:hover {
  background: #8b5cf6;
}

/* Result Box */
#resultBox, #historyBox {
  margin-top: 28px;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(10px);
  padding: 24px;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  display: none;
  animation: slideIn 0.4s ease;
}

body.dark #resultBox,
body.dark #historyBox {
  background: rgba(30, 41, 59, 0.6);
}

#resultBox.show,
#historyBox.show {
  display: block;
}

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

#shortUrlBox {
  background: linear-gradient(135deg, #f0fdf4 0%, #dbeafe 100%);
  padding: 16px 20px;
  border-radius: 16px;
  border: 2px solid rgba(16, 185, 129, 0.2);
  margin-bottom: 20px;
  word-break: break-word;
  position: relative;
  overflow: hidden;
}

body.dark #shortUrlBox {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.3) 0%, rgba(30, 58, 138, 0.3) 100%);
  border-color: rgba(16, 185, 129, 0.3);
}

#shortUrlBox::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 2s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

/* QR Code */
#qrCode {
  display: flex;
  justify-content: center;
  margin: 24px 0;
}

#qrCode canvas {
  border-radius: 16px;
  padding: 16px;
  background: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* History */
#historyBox h3 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #6366f1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.dark #historyBox h3 {
  color: #a78bfa;
}

#historyList {
  list-style: none;
  padding: 0;
  margin: 0;
}

#historyList li {
  background: rgba(255, 255, 255, 0.6);
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  border: 1px solid rgba(99, 102, 241, 0.1);
}

body.dark #historyList li {
  background: rgba(51, 65, 85, 0.4);
  border-color: rgba(139, 92, 246, 0.2);
}

#historyList li:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

#historyList li a {
  color: #6366f1;
  text-decoration: none;
  flex: 1;
  word-break: break-word;
  font-size: 14px;
}

body.dark #historyList li a {
  color: #a78bfa;
}

#historyList li a:hover {
  text-decoration: underline;
}

.delete-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 16px;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}

.clear-history-btn {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.clear-history-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Toast */
#appToast {
  min-width: 280px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 10000;
}

#appToast .toast-body {
  font-weight: 600;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 640px) {
  body {
    padding: 40px 16px 80px;
  }
  
  .container {
    padding: 28px 20px;
    border-radius: 20px;
  }
  
  h1 {
    font-size: 26px;
  }
  
  .toggle-dark {
    width: 48px;
    height: 48px;
    top: 16px;
    right: 16px;
  }
  
  .btn {
    padding: 12px 24px;
    font-size: 14px;
  }
  
  #historyList li {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
