/* ===== Base / App Shell ===== */

body {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  background-image: linear-gradient(#000, transparent);
  width: 100%;
  height: 100%;
  z-index: -1;
}

.app {
  max-width: 560px;
  width: 100%;
  padding: 2rem 1.5rem;
}

/* ===== Header ===== */

.app__header {
  margin-bottom: 2rem;
}

.app__title {
  margin-bottom: 0.5rem;
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 1.33;
}

.app__subtitle {
  font-size: 1.25rem;
  line-height: 1.5;
  opacity: 0.8;
}

/* ===== Line List ===== */

.app__line-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* ===== Line Card ===== */

.line-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.3s, background 0.3s, opacity 0.3s;
}

/* -- Status modifiers -- */

.line-card--checking {
  border-color: rgba(255, 255, 255, 0.25);
  animation: pulse-border 1.5s ease-in-out infinite;
}

.line-card--online {
  border-color: rgba(72, 199, 142, 0.7);
  background: rgba(72, 199, 142, 0.1);
}

.line-card--offline {
  border-color: rgba(255, 82, 82, 0.5);
  opacity: 0.6;
}

.line-card--timeout {
  border-color: rgba(255, 171, 64, 0.5);
  opacity: 0.6;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(255, 255, 255, 0.12); }
  50% { border-color: rgba(255, 255, 255, 0.35); }
}

/* -- Card children -- */

.line-card__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  min-width: 0;
}

.line-card__name {
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

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

.line-card__region {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  line-height: 1.5;
}

.line-card__latency {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* -- Status badge -- */

.line-card__status {
  font-size: 0.8rem;
  font-weight: 500;
  flex-shrink: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.line-card__status--checking {
  color: rgba(255, 255, 255, 0.7);
}

.line-card__status--online {
  color: #48c78e;
}

.line-card__status--offline {
  color: #ff5252;
}

.line-card__status--timeout {
  color: #ffab40;
}

/* -- Go button -- */

.line-card__btn {
  flex-shrink: 0;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(72, 199, 142, 0.85);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.line-card__btn:hover {
  background: rgba(72, 199, 142, 1);
}

.line-card__btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
}

/* ===== Bottom Status Area ===== */

.app__status {
  font-size: 1rem;
  line-height: 1.6;
  min-height: 1.6em;
}

.app__timeout-msg {
  color: #ffab40;
}

.app__error-msg {
  color: #ff5252;
}

/* ===== Loading Dots ===== */

.lds-ellipsis {
  display: inline-block;
  position: relative;
  width: 40px;
  height: 10px;
}

.lds-ellipsis div {
  position: absolute;
  top: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}

.lds-ellipsis div:nth-child(1) {
  left: 6px;
  animation: lds-ellipsis1 0.6s infinite;
}

.lds-ellipsis div:nth-child(2) {
  left: 6px;
  animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(3) {
  left: 17px;
  animation: lds-ellipsis2 0.6s infinite;
}

.lds-ellipsis div:nth-child(4) {
  left: 28px;
  animation: lds-ellipsis3 0.6s infinite;
}

@keyframes lds-ellipsis1 {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

@keyframes lds-ellipsis2 {
  0% { transform: translate(0, 0); }
  100% { transform: translate(10px, 0); }
}

@keyframes lds-ellipsis3 {
  0% { transform: scale(1); }
  100% { transform: scale(0); }
}

/* ===== Responsive ===== */

@media (max-width: 768px) {
  .app__title {
    font-size: 1.75rem;
  }

  .app__subtitle {
    font-size: 1rem;
  }

  .app {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 400px) {
  .app__title {
    font-size: 1.4rem;
  }

  .line-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .line-card__btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }
}
