/* ---- Base ------------------------------------------------------------ */
:root {
  --black: #000;
  --black-hover: #333;
  --white: #fff;

  --gray-50: #f9fafb;
  --gray-100: #f9f9f9;
  --gray-200: #e5e5e5;
  --gray-300: #e5e7eb;
  --gray-400: #bcc1c8;
  --gray-500: #888;
  --gray-700: #374151;

  --accent: #ff7026;
  --accent-hover: #e4601e;

  --bg-red-overlay: rgba(255, 0, 0, 0.08);
  --bg-blue-overlay: rgba(0, 0, 255, 0.06);
  --bg-yellow-overlay: rgba(255, 255, 0, 0.05);
  --bg-green-overlay: rgba(0, 128, 0, 0.07);
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--black);
  line-height: 1.5;
  background:
    radial-gradient(circle at top left, var(--bg-red-overlay), transparent 50%),
    radial-gradient(circle at top right, var(--bg-blue-overlay), transparent 50%),
    radial-gradient(circle at bottom left, var(--bg-yellow-overlay), transparent 50%),
    radial-gradient(circle at bottom right, var(--bg-green-overlay), transparent 50%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 4rem 1rem 1.5rem 1rem;
}

/* ---- Layout wrapper -------------------------------------------------- */
.content-container {
  display: contents;
}

.container {
  max-width: 680px;
  width: 100%;
  text-align: center;
  min-height: 100%;
  flex-grow: 1;
}

/* ---- See More tag -------------------------------------------------------- */
.see-more {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: 9999px;
  background: var(--white);
}

.see-more-btn a, i {
  color: inherit;
  text-decoration: none;
  align-items: center;
  color: var(--accent);
}

/* ---- Hero title & subtitle ------------------------------------------ */
h1 {
  font-size: 3rem;
  font-weight: 700;
  margin: 1.25rem 0 1rem;
  line-height: 1.1;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--gray-500);
  margin-bottom: 2rem;
}

/* ---- Shorten box ----------------------------------------------------- */
.shorten-box {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  overflow: hidden;
  max-width: 640px;
  margin: 0 auto 0.5rem;
}

.shorten-box input {
  flex: 1;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  outline: none;
}

.shorten-box input::placeholder {
  opacity: 0.5;
}

.shorten-box button {
  background: var(--accent);
  color: var(--white);
  border: none;
  font-size: 1rem;
  padding: 0 2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.shorten-box button:hover {
  background: var(--accent-hover);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #ccc;
  border-top: 2px solid #333;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.input-error {
  border: 2px solid #f97316; 
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.3);
  transition: all 0.2s ease;
}

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

/* ---- Form Option ------------------------------------------------------ */
.form-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: 608px;
  margin: 0 auto 1.5rem;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.85rem;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: #2f3e4e;
  white-space: nowrap;
}

.toggle input[type="checkbox"] {
  appearance: none;
  width: 30px;
  height: 16px;
  background: #d0d8df;
  border-radius: 16px;
  position: relative;
  outline: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle input[type="checkbox"]:checked {
  background: var(--accent);
}

.toggle input[type="checkbox"]:checked::before {
  transform: translateX(14px);
}

.label-text {
  font-size: 13px;
}

/* ---- Setting icon ------------------------------------------------------ */
.alias-wrapper {
  position: relative;
  width: 100%;
}

.settings-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: none; 
  font-size: 16px;
}

.fa-sliders-h:before, .fa-sliders:before {
  color: var(--gray-400);
}

.fa-sliders.active::before {
  color: var(--accent);
}

/* ---- Link cards ------------------------------------------------------ */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  background: var(--white);
}

.left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

.link-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
  flex: 1;
}

.link-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slug {
  font-weight: 600;
  font-size: 1rem;
}

.slug a{
  text-decoration: none;
  color: var(--black);
}

.dest {
  font-size: 0.75rem;
  color: var(--gray-500);
}

.stats {
  font-size: 0.75rem;
  color: var(--gray-500);
  white-space: nowrap;
}

.right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.icon-btn {
  width: 2rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--accent);
}

.link-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.clicks {
  font-weight: 500;
  color: var(--gray-700);
}

.expires {
  background: var(--gray-300);
  padding: 0.25rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  color: var(--gray-500);
}

@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slideDown 0.5s ease;
}

/* ---- Skeleton ---------------------------------------------------------- */
.skeleton-icon,
.skeleton-text,
.skeleton-icon-btn {
  background: linear-gradient(
    90deg,
    var(--gray-100) 25%,
    var(--gray-200) 50%,
    var(--gray-100) 75%
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.2s infinite;
  border-radius: 0.5rem;
}

.skeleton-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.skeleton-text {
  height: 0.75rem;
  margin: 0.25rem 0;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-text.long {
  width: 80%;
}

.skeleton-text.small {
  width: 60px;
  height: 0.625rem;
  border-radius: 0.375rem;
}

.skeleton-icon-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.skeleton-see-more {
  width: 150px;
  height: 1.5rem;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    var(--gray-100) 25%,
    var(--gray-200) 50%,
    var(--gray-100) 75%
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.2s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* ---- Footer ---------------------------------------------------------- */
.footer {
  font-family: 'Courier Prime', monospace;
  font-size: 0.875rem;
  color: var(--gray-400);
  text-align: center;
  max-width: 680px;
}

.footer a {
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
}

/* ---- Toas Notification ----------------------------------------------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: calc(100% - 40px);
}

.toast-notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    transform: translateX(120%) scale(0.9);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    position: relative;
}

.toast-notification.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast-notification.hide {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
    transition: all 0.4s ease-in-out;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.toast-icon svg {
    width: 14px;
    height: 14px;
    fill: white;
}

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

.toast-message {
    font-size: 14px;
    margin: 4px 0 0 0;
    color: #6b7280;
    line-height: 1.4;
    text-align: left;
}

.close-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 2px;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.close-btn:hover {
    background: #f3f4f6;
    color: #6b7280;
}

.close-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* ---- Responsiveness Longer 640px ------------------------------------- */
@media (min-width: 640px) {
  .shorten-box input[type="text"] {
    max-width: 32%;
    border-left: 1px solid var(--gray-200);
  }

  .expires {
    min-width: 7rem;
  }

  .alias-wrapper {
    display: contents;
  }
}

/* ---- Responsiveness Less 640 px ---------------------------------------*/
@media (max-width: 640px) {

  body {
    min-height: 100dvh;
  }
  
  h1 {
    font-size: 2.25rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .shorten-box {
    flex-direction: column;
    margin: 0 auto 1.5rem;
  }

  .form-options {
    display: none;
  }

  .shorten-box button {
    width: 100%;
    padding: 1rem 0;
  }

  .shorten-box input[type="text"] {
    border-top: 1px solid var(--gray-200);
  }

  .expires {
    min-width: 3.5rem;
  }

  #input-alias {
    width: 100%;
    padding-right: 55px; 
  }

  .settings-icon {
    display: inline-block;
  }

  .form-options.force-show {
    display: flex !important;
  }



  @supports (height: 100dvh) {
    body {
      min-height: 100dvh; 
    }
  }
}


/* ---- Responsiveness Less 480 px ---------------------------------------*/
@media (max-width: 480px) {
  .toast-container {
      top: 16px;
      right: 16px;
      left: 16px;
      max-width: none;
      width: calc(100% - 32px);
  }

  .toast-notification {
      transform: translateY(-120%) scale(0.9);
  }

  .toast-notification.show {
      transform: translateY(0) scale(1);
  }

  .toast-notification.hide {
      transform: translateY(-120%) scale(0.9);
  }
}