﻿* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, #ecfdf5, transparent 60%),
    radial-gradient(circle at bottom right, #f0fdfa, transparent 55%),
    #f8fafc;
  color: #0f172a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px;
  height: 100%;
  min-height: unset;
  overflow: visible;
}

h1 {
  font-size: 2rem;
  font-weight: 400;
  margin-top: 8px; 
  margin-bottom: 22px;
}


//* ===========================
   ITEM BASE
=========================== */
.ambiente-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
  padding: 18px 20px;
  border-radius: 16px;

  font-weight: 600;
  color: #1f2937;

  border-left: 6px solid transparent;
  transition: background 0.25s ease, border-color 0.25s ease;
}

/* ===========================
   BOLINHA INDICADORA
=========================== */
.ambiente-item::before {
  content: "●";
  font-size: 0.7rem;
  margin-right: 6px;
}

/* ===========================
   STATUS WRAPPER
=========================== */
.status-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* badge do status */
.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ===========================
   STATUS OK
=========================== */
.ambiente-item.status-ok {
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border-left-color: #22c55e;
}

.ambiente-item.status-ok::before {
  color: #22c55e;
}

.status-badge.status-ok {
  background: #dcfce7;
  color: #166534;
}

/* ===========================
   STATUS WARNING
=========================== */
.ambiente-item.status-warning {
  background: linear-gradient(135deg, #fff7ed, #fffbeb);
  border-left-color: #f59e0b;
}

.ambiente-item.status-warning::before {
  color: #f59e0b;
}

.status-badge.status-warning {
  background: #fef3c7;
  color: #92400e;
}

/* ===========================
   STATUS ERROR
=========================== */
.ambiente-item.status-error {
  background: linear-gradient(135deg, #fef2f2, #fff1f2);
  border-left-color: #ef4444;
}

.ambiente-item.status-error::before {
  color: #ef4444;
}

.status-badge.status-error {
  background: #fee2e2;
  color: #7f1d1d;
}

/* ===========================
   STATUS INDISPONÍVEL
=========================== */
.ambiente-item.status-indisponivel {
  background: #f4f4f5;
  border-left-color: #a1a1aa;
}

.ambiente-item.status-indisponivel::before {
  color: #a1a1aa;
}

.status-badge.status-indisponivel {
  background: #e4e4e7;
  color: #52525b;
}

.status-link {
  text-decoration: none;
  color: inherit;
  font-weight: inherit;
}

.status-link:hover {
  text-decoration: underline;
}


#searchForm {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);

  display: flex;
  flex-direction: column;
  gap: 14px;
}

#searchForm label {
  font-size: 0.85rem;
  font-weight: 600;
}

#searchForm input {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #d1fae5;
  font-size: 1rem;
}

#searchForm input:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

#searchForm button {
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

#result {
  width: 100%;
  max-width: 420px;
}

.titulo-resultado {
  margin-top: 22px;
  margin-bottom: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #006644;
  animation: fadeInSoft 0.3s ease-out;
}

.hidden {
  display: none;
}

#urls {
  list-style: none;
  display: grid;
  gap: 14px;
  animation: fadeInSoft 0.35s ease-out;
}

#urls li {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

#urls li.ambiente {
  font-weight: 700;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border-left: 6px solid #22c55e;
  color: #065f46;
}

#urls a {
  display: inline-block;
  margin-top: 6px;
  color: #00875f;
  font-weight: 600;
  text-decoration: none;
}

@keyframes fadeInSoft {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

   /* ===========================
   STATUS DROPDOWN
=========================== */

.status-wrapper {
  position: relative;
  display: inline-block;
  margin-left: 8px;
}

.status-dropdown {
  position: absolute;
  top: 120%;
  left: 0;
  min-width: 180px;

  background: #ffffff;
  color: #333;
  padding: 10px 12px;

  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);

  font-size: 13px;
  line-height: 1.4;

  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);

  transition: all 0.2s ease;
  z-index: 10;
}

/* seta do dropdown */
.status-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 16px;

  width: 10px;
  height: 10px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 6px rgba(0, 0, 0, 0.04);
}

/* hover */
.status-wrapper:hover .status-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===========================
   BADGES (caso ainda não tenha)
=========================== */

.status-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
}

.status-ok {
  background: #e6f7ef;
  color: #198754;
}

.status-warning {
  background: #fff4e5;
  color: #d17b00;
}

.status-error {
  background: #fdecea;
  color: #dc3545;
}

.status-indisponivel {
  background: #f1f1f1;
  color: #666;
}

@media (max-height: 760px), (max-width: 640px) {
  body {
    overflow-y: auto;
  }
}


@media (max-width: 460px) {

  body {
    padding: 16px;
    align-items: stretch;
  }

  h1 {
    font-size: 1rem;
    text-align: center;
  }

  /* formulário */
  #searchForm {
    max-width: 100%;
    padding: 18px;
    border-radius: 14px;
  }

  #searchForm input,
  #searchForm button {
    font-size: 0.95rem;
    padding: 12px 14px;
  }

  /* resultado */
  #result {
    max-width: 100%;
  }

  .titulo-resultado {
    text-align: center;
  }

  /* itens de ambiente */
  .ambiente-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px 16px;
  }

  /* bolinha antes do nome */
  .ambiente-item::before {
    font-size: 0.65rem;
  }

  /* status */
  .status-wrapper {
    margin-left: 0;
    align-self: flex-start;
  }

  .status-badge {
    font-size: 0.7rem;
    padding: 5px 10px;
  }

  /* dropdown de status */
  .status-dropdown {
    min-width: 220px;
    left: 0;
    right: auto;
  }

  .status-dropdown::before {
    left: 14px;
  }

  /* lista de URLs */
  #urls {
    gap: 12px;
  }

  #urls li {
    padding: 14px 16px;
  }

  #urls a {
    word-break: break-all;
    font-size: 0.9rem;
  }
}