/* ===== Container & Layout ===== */
.tl-container {
  max-width: 100%;
  margin: 2rem auto;
  padding: 2.5rem;
  background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 
              0 0 0 1px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.tl-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FF0050, #00F2EA, #FF0050);
  background-size: 200% 100%;
  animation: tl-gradient 3s ease infinite;
}

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

/* ===== Form ===== */
.tl-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  align-items: center;
}

/* ===== Input Wrapper ===== */
.tl-input-wrapper {
  position: relative;
  width: 100%;
}

/* ===== Input Field ===== */
.tl-input {
  width: 100%;
  padding: 1.25rem 5.5rem 1.25rem 1.5rem;
  font-size: 1.05rem;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
}

.tl-input::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.tl-input:hover {
  border-color: #d1d5db;
  background: #fafafa;
}

.tl-input:focus {
  border-color: #FF0050;
  box-shadow: 0 0 0 4px rgba(255, 0, 80, 0.1),
              0 8px 16px rgba(255, 0, 80, 0.1);
  outline: none;
  background: #ffffff;
  transform: translateY(-1px);
}

/* ===== Paste Button ===== */
.tl-paste {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  border: none;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  color: #ffffff;
  padding: 0.35rem 0.65rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tl-paste:hover,
.tl-paste:focus {
  background: linear-gradient(135deg, #111827 0%, #000000 100%);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.tl-paste:active {
  transform: translateY(-50%) scale(0.98);
}

/* ===== Submit Button ===== */
.tl-submit {
  width: 50%;
  padding: 1.25rem 2rem;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, #FF0050 0%, #ff1744 50%, #FF0050 100%);
  background-size: 200% 100%;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(255, 0, 80, 0.3),
              0 2px 8px rgba(255, 0, 80, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.tl-submit::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.tl-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 0, 80, 0.4),
              0 4px 12px rgba(255, 0, 80, 0.3);
  background-position: 100% 50%;
}

.tl-submit:hover::before {
  left: 100%;
}

.tl-submit:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(255, 0, 80, 0.3);
}

.tl-submit:focus {
  outline: none;
  box-shadow: 0 12px 32px rgba(255, 0, 80, 0.4),
              0 0 0 4px rgba(255, 0, 80, 0.2);
}

.tl-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #d1d5db;
}

/* ===== Alert Messages ===== */
.tl-alert {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: tl-slideIn 0.3s ease;
}

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

.tl-alert::before {
  content: '⚠';
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tl-alert--error {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #dc2626;
  border: 2px solid #fca5a5;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
}

.tl-alert--success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  color: #16a34a;
  border: 2px solid #86efac;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.1);
}

.tl-alert--success::before {
  content: '✓';
}

/* ===== Result Container ===== */
.tl-result {
  max-width: 100%;
  margin: 2rem auto;
  padding: 2.5rem;
  background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08),
              0 0 0 1px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
  animation: tl-fadeIn 0.5s ease;
}

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

.tl-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #FF0050, #00F2EA, #FF0050);
  background-size: 200% 100%;
  animation: tl-gradient 3s ease infinite;
}

/* ===== Result Header ===== */
.tl-result__header {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #f3f4f6;
}

.tl-result__media {
  flex-shrink: 0;
}

.tl-result__media img {
  width: 140px;
  height: 140px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 12px 32px rgba(255, 0, 80, 0.2),
              0 0 0 3px #ffffff,
              0 0 0 5px rgba(255, 0, 80, 0.1);
  transition: transform 0.3s ease;
}

.tl-result__media img:hover {
  transform: scale(1.05) rotate(2deg);
}

.tl-result__meta {
  flex: 1;
  min-width: 0;
}

.tl-result__nickname {
  margin: 0 0 0.75rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}

.tl-result__description {
  margin: 0;
  color: #6b7280;
  line-height: 1.6;
  font-size: 1rem;
}

.tl-result__description strong {
  color: #374151;
  font-weight: 600;
}

/* ===== Downloads Section ===== */
.tl-downloads {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  
}

.tl-downloads__group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tl-downloads__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.15rem 1.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #00F2EA 0%, #00d4cc 100%);
  color: #111827;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 8px 24px rgba(0, 242, 234, 0.3),
              0 2px 8px rgba(0, 242, 234, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tl-downloads__button::before {
  content: '⬇';
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.tl-downloads__button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 242, 234, 0.4),
              0 4px 12px rgba(0, 242, 234, 0.3);
  background: linear-gradient(135deg, #00d4cc 0%, #00bfb8 100%);
}

.tl-downloads__button:hover::before {
  transform: translateY(2px);
}

.tl-downloads__button:active {
  transform: translateY(0);
}

.tl-downloads__button.downloading {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

.tl-progress {
  margin-left: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1f2937;
}

/* ===== Empty State ===== */
.tl-empty {
  margin: 0;
  padding: 2rem;
  text-align: center;
  color: #9ca3af;
  font-size: 1rem;
  background: #f9fafb;
  border-radius: 12px;
}

/* ===== Footer ===== */
.tl-footer {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 2px solid #f3f4f6;
  text-align: center;
}

.tl-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #FF0050;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.tl-back:hover {
  background: rgba(255, 0, 80, 0.1);
  gap: 0.75rem;
}

/* ===== Message ===== */
.tl-message {
  text-align: center;
  padding: 2rem;
}

.tl-message h2 {
  margin-bottom: 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
}

/* ===== Loading State ===== */
.tl-form--processing {
  pointer-events: none;
  position: relative;
}

.tl-form--processing .tl-input,
.tl-form--processing .tl-submit {
  opacity: 0.6;
}

.tl-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 250, 0.95) 100%);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  z-index: 10;
  border-radius: 16px;
  animation: tl-fadeIn 0.3s ease;
}

.tl-loading-icon {
  width: 50px;
  height: 50px;
  border: 4px solid #fee;
  border-top: 4px solid #FF0050;
  border-right: 4px solid #00F2EA;
  border-radius: 50%;
  animation: tl-spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes tl-spin {
  0% { 
    transform: rotate(0deg);
  }
  100% { 
    transform: rotate(360deg);
  }
}

.tl-overlay span {
  font-size: 1.1rem;
  font-weight: 700;
  color: #FF0050;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: tl-pulse 2s ease infinite;
}

@keyframes tl-pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .tl-container {
    margin: 1rem;
    padding: 1.75rem 1.5rem;
    border-radius: 20px;
  }
  
  .tl-input {
    padding: 1.1rem 5rem 1.1rem 1.25rem;
    font-size: 1rem;
  }
  
  .tl-paste {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    right: 0.6rem;
  }
  
  .tl-submit {
    padding: 1.15rem 1.5rem;
    font-size: 1rem;
  }
  
  .tl-result {
    margin: 1rem;
    padding: 1.75rem 1.5rem;
    border-radius: 20px;
  }
  
  .tl-result__header {
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
  }
  
  .tl-result__media {
    align-self: center;
  }
  
  .tl-result__media img {
    width: 120px;
    height: 120px;
  }
  
  .tl-result__nickname {
    font-size: 1.5rem;
    text-align: center;
  }
  
  .tl-result__description {
    font-size: 0.95rem;
    text-align: center;
  }
  
  .tl-downloads__button {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  
  .tl-alert {
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .tl-container {
    margin: 0.75rem;
    padding: 1.5rem 1.25rem;
  }
  
  .tl-input {
    padding: 1rem 4.5rem 1rem 1rem;
    font-size: 0.95rem;
  }
  
  .tl-paste {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    right: 0.5rem;
  }
  
  .tl-submit {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }
  
  .tl-result {
    margin: 0.75rem;
    padding: 1.5rem 1.25rem;
  }
  
  .tl-result__media img {
    width: 100px;
    height: 100px;
  }
  
  .tl-result__nickname {
    font-size: 1.35rem;
  }
  
  .tl-loading-icon {
    width: 40px;
    height: 40px;
  }
  
  .tl-overlay span {
    font-size: 1rem;
  }
}

/* ===== Accessibility ===== */
.tl-input:focus-visible,
.tl-submit:focus-visible,
.tl-paste:focus-visible,
.tl-downloads__button:focus-visible,
.tl-back:focus-visible {
  outline: 3px solid #FF0050;
  outline-offset: 2px;
}

/* ===== Dark Mode Support (Optional) ===== */
@media (prefers-color-scheme: dark) {
  .tl-container,
  .tl-result {
    background: linear-gradient(145deg, #1f2937 0%, #111827 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05);
  }
  
  .tl-input {
    background: #374151;
    border-color: #4b5563;
    color: #f9fafb;
  }
  
  .tl-input::placeholder {
    color: #9ca3af;
  }
  
  .tl-input:hover {
    background: #4b5563;
    border-color: #6b7280;
  }
  
  .tl-input:focus {
    background: #374151;
  }
  
  .tl-result__nickname {
    color: #f9fafb;
  }
  
  .tl-result__description {
    color: #d1d5db;
  }
  
  .tl-result__description strong {
    color: #e5e7eb;
  }
  
  .tl-result__header {
    border-bottom-color: #374151;
  }
  
  .tl-footer {
    border-top-color: #374151;
  }
  
  .tl-empty {
    background: #374151;
    color: #9ca3af;
  }
  
  .tl-overlay {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
  }
}
