/* --- PHẦN ANIMATION "GỐC" CỦA KHƯƠNG --- */
.logo-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 60px; /* Tăng từ 20px lên 60px để Logo có không gian thở */
}

.bee-icon {
  position: absolute;
  width: 50px;
  height: 50px;
  pointer-events: none;
  z-index: 10;
}

.bee-big {
  top: -15px;
  left: -25px;
  animation: flyBig 8s ease-in-out infinite;
}

.bee-small {
  top: 5px;
  left: -35px;
  transform: scale(0.8);
  opacity: 0.9;
  animation: flySmall 8s ease-in-out infinite;
  animation-delay: -2s;
}

@keyframes flyBig {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(120px, -35px) rotate(8deg); }
  50% { transform: translate(240px, 0) rotate(-5deg); }
  75% { transform: translate(120px, 35px) rotate(6deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes flySmall {
  0% { transform: translate(0, 0) scale(0.8) rotate(0deg); }
  25% { transform: translate(100px, -20px) scale(0.8) rotate(6deg); }
  50% { transform: translate(200px, 10px) scale(0.8) rotate(-4deg); }
  75% { transform: translate(100px, 30px) scale(0.8) rotate(5deg); }
  100% { transform: translate(0, 0) scale(0.8) rotate(0deg); }
}

.bee-icon ellipse {
  transform-origin: center;
  animation: flap 0.25s infinite alternate;
}

@keyframes flap {
  from { transform: scaleY(1); }
  to { transform: scaleY(0.7); }
}

/* --- PHẦN UI "TÚT LẠI" --- */
:root {
  --input-height: 56px; /* Cố định chiều cao để tránh vênh trên Mobile */
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #fff1f2 0%, #fff7ed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

.container {
  text-align: center;
  width: 100%;
  max-width: 800px; /* Tăng nhẹ để bao quát input rộng hơn */
  padding: 20px;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 64px; /* Tăng size một chút cho sang */
  margin: 0;
  letter-spacing: -1px;
}

.bee {
  background: linear-gradient(90deg, #fb7185, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  font-size: 20px;
  margin-bottom: 10px;
}

/* Input & Form - Sửa lỗi vênh height */
.form {
  display: flex;
  align-items: stretch; /* Đảm bảo con bên trong cao bằng nhau tuyệt đối */
  background: white;
  padding: 5px; /* Giảm padding container để tập trung vào height của con */
  border-radius: 50px;
  box-shadow: 0 20px 40px rgba(249, 115, 22, 0.08);
  max-width: 640px; /* Mở rộng input field ra thêm */
  margin: 50px auto 0;
  height: var(--input-height);
  box-sizing: border-box;
}

.input-group {
  flex: 1;
  display: flex;
}

.input-group input {
  width: 100%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 25px;
  font-size: 16px;
  outline: none;
  height: 100%;
  -webkit-appearance: none; /* Khử style mặc định của iPhone */
  border-radius: 50px 0 0 50px;
}

#shortenBtn {
  height: 100%;
  padding: 0 35px;
  border-radius: 50px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  background: linear-gradient(90deg, #fb7185, #f97316);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-appearance: none; /* Khử style mặc định của iPhone */
}

#shortenBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(249, 115, 22, 0.3);
}

#shortenBtn:active {
  transform: scale(0.98);
}

/* Warning & Result */
.warning {
  position: absolute;
  bottom: -30px;
  left: 25px;
  font-size: 13px;
  color: #fb7185;
  opacity: 0;
  transition: 0.3s;
}

.warning.show { opacity: 1; }

.result.hidden { display: none; }
.result.show { display: block; }

.result-box {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(249, 115, 22, 0.1);
  border-radius: 20px;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 500px;
  margin: 30px auto 0;
  animation: slideUp 0.5s ease;
}

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

#shortUrl {
  font-weight: 500;
  color: #1f2937;
}

#copyBtn {
  background: transparent;
  color: #f97316;
  border: none;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.2s;
}

#copyBtn:hover { background: rgba(249, 115, 22, 0.08); }

/* Responsive cho màn hình cực nhỏ */
@media (max-width: 480px) {
  .logo { font-size: 48px; }
  .form { height: auto; flex-direction: column; border-radius: 20px; padding: 10px; }
  .input-group input { padding: 15px; text-align: center; }
  #shortenBtn { width: 100%; height: 50px; border-radius: 15px; }
  .logo-wrap { margin-bottom: 40px; }
}
:root {
  --primary: linear-gradient(90deg, #fb7185, #f97316);
  --input-h: 60px; /* Chiều cao cố định để fix lỗi iPhone */
}

/* Logo & Spacing */
.logo-wrap {
  margin-bottom: 70px; /* Tăng không gian thở cho Logo */
  position: relative;
  display: inline-block;
}

.tagline {
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 30px;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  cursor: pointer;
  transition: 0.3s;
  border-radius: 20px;
}

.tab-btn.active {
  background: #fff;
  color: #f97316;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Form Container - Fix vênh và mở rộng */
.form {
  display: flex;
  align-items: stretch; /* Đảm bảo nút và input cao bằng nhau */
  background: white;
  padding: 6px;
  border-radius: 35px;
  box-shadow: 0 20px 40px rgba(249, 115, 22, 0.1);
  max-width: 640px; /* Mở rộng theo ý Khương */
  margin: 0 auto;
  min-height: var(--input-h);
  transition: all 0.3s ease;
}

/* Khi ở chế độ Textarea, cho phép form cao lên */
.form.expand {
  border-radius: 24px;
  flex-direction: column;
}

.input-group {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

/* Input & Textarea */
#urlInput, #textInput {
  width: 100%;
  border: none;
  outline: none;
  font-size: 16px;
  background: transparent;
  -webkit-appearance: none; /* Khử style mặc định của iOS */
}

#textInput {
  padding: 15px 20px;
  min-height: 200px;
  resize: none;
}

/* Button Shorten */
#shortenBtn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0 30px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form.expand #shortenBtn {
  margin-top: 10px;
  height: 50px;
}

#shortenBtn:hover { transform: scale(1.02); }

/* Warning */
.warning {
  position: absolute;
  bottom: -25px;
  left: 20px;
  font-size: 12px;
  color: #fb7185;
  opacity: 0;
}
.warning.show { opacity: 1; }

/* Responsive Mobile */
@media (max-width: 480px) {
  .logo { font-size: 48px; }
  .logo-wrap { margin-bottom: 50px; }
  .form { width: 95%; }
}