/* =========================
   GOOGLE FONT & RESET
========================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* =========================
   BODY
========================= */
body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #f8f9fa;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================
      HEADER + LOGO
========================= */
.app-header {
  text-align: center;
  margin: 30px 0 50px;
  padding-top: 10px;
}

/* FOTO PROFIL BULAT */
.profile-logo {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #10b981;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  transition: .3s ease;
}
.profile-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
}
.profile-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-title {
  font-size: 2.4rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
}

.app-title .fab.fa-tiktok {
  font-size: 2.8rem;
  animation: pulse 2.5s infinite ease-in-out;
}

.app-tagline {
  font-size: 1.1rem;
  font-weight: 300;
  color: #aed6f1;
  margin-top: 10px;
}

/* =========================
         CARD UTAMA
========================= */
.app-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.download-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 35px;
  border: 1px solid rgba(255, 255, 255, .1);
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .2);
}

.card-title {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 30px;
  color: #fff;
  position: relative;
}

.card-title::after {
  content: '';
  width: 60px;
  height: 3px;
  background: #10b981;
  border-radius: 3px;
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
}

/* =========================
         INPUT FORM
========================= */
.download-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.input-wrapper {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  transition: .3s ease;
}

.input-wrapper:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}

.input-icon {
  font-size: 1.2rem;
  color: #aed6f1;
  margin-right: 15px;
}

#url {
  width: 100%;
  padding: 18px 0;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 1.05rem;
}

#url::placeholder {
  color: #aed6f1;
}

/* =========================
        BUTTON SUBMIT
========================= */
.button-group {
  display: flex;
  justify-content: center;
}

.btn-download,
.btn-primary,
.btn-secondary {
  padding: 16px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 500;
  width: 100%;
  max-width: 350px;
  text-align: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: .3s ease;
}

.btn-download:hover,
.btn-primary:hover,
.btn-secondary:hover {
  background: #059669;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

/* =========================
      STATUS INDICATOR
========================= */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  color: #aed6f1;
  margin-top: 20px;
}

.status-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: .3s ease;
}

/* STATUS WARNA */
.status-indicator.idle .status-icon {
  background: rgba(174,214,241,.2);
  color: #aed6f1;
}
.status-indicator.loading .status-icon {
  background: rgba(37,99,235,.2);
  color: #3b82f6;
  animation: spin 1.5s linear infinite;
}
.status-indicator.success .status-icon {
  background: rgba(16,185,129,.2);
  color: #10b981;
}
.status-indicator.error .status-icon {
  background: rgba(239,68,68,.2);
  color: #ef4444;
}

.status-text {
  transition: .3s ease;
}

/* =========================
           ALERT
========================= */
.alert {
  display: flex;
  gap: 15px;
  padding: 20px;
  border-radius: 12px;
  margin: 25px 0;
  border: 1px solid transparent;
}

.alert-error {
  background: rgba(239, 68, 68, .15);
  border-color: rgba(239, 68, 68, .3);
  color: #fecdd3;
}

.alert-success {
  background: rgba(16, 185, 129, .15);
  border-color: rgba(16, 185, 129, .3);
  color: #dcfce7;
}

.alert i {
  font-size: 1.5rem;
  margin-top: 2px;
}

.alert h4 {
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.alert p {
  font-size: 1rem;
  font-weight: 300;
}

.alert-detail {
  font-size: .9rem;
  color: #aed6f1;
}

/* =========================
          FOOTER
========================= */
.app-footer {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: auto;
}

.footer-text {
  font-size: .9rem;
  color: #aed6f1;
}

/* =========================
        ANIMASI
========================= */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

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

/* =========================
        LOADER FIX
========================= */
.loader {
  margin: 20px auto;
  width: 45px;
  height: 45px;
  border: 5px solid rgba(255,255,255,0.2);
  border-top-color: #00eaff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* =========================
        RESPONSIVE
========================= */
@media (max-width: 576px) {
  .app-title { font-size: 2rem; }
  .app-title .fab.fa-tiktok { font-size: 2.4rem; }
  .app-tagline { font-size: 1rem; }
  .download-card { padding: 25px; }
  .card-title { font-size: 1.4rem; }
  .btn-download { font-size: 1rem; padding: 14px; }
}

/* ============= RESULT CARD ============= */
.result-card {
  margin-top: 30px;
  padding: 25px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  animation: fadeIn 0.4s ease;
}

.result-card h3 {
  text-align: center;
  margin-bottom: 18px;
  font-size: 1.3rem;
  color: #fff;
}

/* Thumbnail */
.thumb {
  width: 100%;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 0 18px rgba(0,0,0,0.4);
  transition: .3s ease;
}

.thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 0 25px rgba(0,255,200,0.4);
}

/* Buttons container */
.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* BUTTON VIDEO / AUDIO */
.btn-primary,
.btn-secondary {
  padding: 15px;
  border-radius: 12px;
  text-decoration: none;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  transition: 0.3s;
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

/* Video Button */
.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  box-shadow: 0 0 15px rgba(59,130,246,0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(59,130,246,0.6);
}

/* Audio Button */
.btn-secondary {
  background: linear-gradient(135deg, #10b981, #34d399);
  box-shadow: 0 0 15px rgba(16,185,129,0.4);
}

.btn-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px rgba(16,185,129,0.6);
}

/* Fade-in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
