/* ===== TrenchWork Query Styles ===== */

/* 查詢區塊樣式 */
.query-wrap {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.query-intro {
  color: #555;
  line-height: 1.9;
  margin-bottom: 30px;
  padding: 14px 18px;
  background: #f0f7fd;
  border-left: 4px solid #1a6faf;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
}

/* 查詢卡片 */
.query-card {
  background: #ffffff;
  border: 1px solid #d0e4f0;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(26, 111, 175, 0.08);
  padding: 28px 30px;
  margin-bottom: 24px;
}

.query-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a6faf;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #d0e4f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.query-card-title svg {
  width: 18px;
  height: 18px;
  fill: #1a6faf;
  flex-shrink: 0;
}

/* 表單行 */
.query-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.query-label {
  font-size: 14px;
  color: #444;
  white-space: nowrap;
  font-weight: 500;
  min-width: 130px;
}

/* 准照號碼輸入組 */
.license-input-group {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
}

.license-input-group input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 14px;
  border: 1px solid #b0cce0;
  border-radius: 5px;
  outline: none;
  color: #333;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-align: center;
}

.license-input-group input:focus {
  border-color: #1a6faf;
  box-shadow: 0 0 0 3px rgba(26, 111, 175, 0.12);
}

.license-sep {
  font-size: 20px;
  color: #888;
  padding: 0 6px;
  flex-shrink: 0;
  line-height: 1;
}

/* 地點輸入 */
.place-input {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
  padding: 7px 12px;
  font-size: 14px;
  border: 1px solid #b0cce0;
  border-radius: 5px;
  outline: none;
  color: #333;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.place-input:focus {
  border-color: #1a6faf;
  box-shadow: 0 0 0 3px rgba(26, 111, 175, 0.12);
}

/* 搜尋按鈕 */
.btn-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 22px;
  background-color: #1a6faf;
  color: #ffffff !important;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.btn-search:hover {
  background-color: #155a8e;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(26, 111, 175, 0.28);
}

.btn-search:active {
  transform: translateY(0);
}

.btn-search svg {
  width: 15px;
  height: 15px;
  fill: #ffffff;
}

/* 備註區 */
.query-note {
  background: #fffbf0;
  border: 1px solid #f0d080;
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 8px;
  font-size: 13px;
  color: #665500;
  line-height: 2;
}

.query-note strong {
  color: #444;
}

/* 結果區塊 */
.result-wrap {
  display: none;
  margin-top: 28px;
}

.result-wrap.visible {
  display: block;
}

.result-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a6faf;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #d0e4f0;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.result-table thead tr {
  background: linear-gradient(90deg, #1a6faf, #2e8ecf);
  color: #fff;
}

.result-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  border: none;
}

.result-table tbody tr {
  border-bottom: 1px solid #e8eef5;
  transition: background 0.15s;
}

.result-table tbody tr:nth-child(even) {
  background: #f4f8fc;
}

.result-table tbody tr:hover {
  background: #ddeef9;
}

.result-table tbody td {
  padding: 10px 14px;
  color: #333;
  vertical-align: middle;
}

.result-table-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #d0e4f0;
  box-shadow: 0 2px 8px rgba(26, 111, 175, 0.08);
}

.no-result,
.no-results {
  text-align: center;
  padding: 30px;
  color: #888;
  font-size: 14px;
}

/* 載入中 */
.loading {
  text-align: center;
  padding: 30px;
  color: #1a6faf;
  font-size: 14px;
}

.loading::after {
  content: '...';
  animation: dots 1.5s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* 錯誤訊息 */
.error {
  text-align: center;
  padding: 30px;
  color: #d32f2f;
  font-size: 14px;
  background: #ffebee;
  border-radius: 8px;
  border: 1px solid #ef9a9a;
}

/* 結果項目 */
.result-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-item {
  background: #ffffff;
  border: 1px solid #d0e4f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(26, 111, 175, 0.08);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.result-item:hover {
  box-shadow: 0 4px 16px rgba(26, 111, 175, 0.15);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: linear-gradient(90deg, #1a6faf, #2e8ecf);
  color: #fff;
}

.license-number {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-badge {
  font-size: 12px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  font-weight: 500;
}

.result-body {
  padding: 16px 20px;
}

.info-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f7fd;
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  min-width: 230px;
  color: #666;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.info-row .value {
  flex: 1;
  color: #333;
  font-size: 14px;
}

.map-link {
  color: #1a6faf;
  text-decoration: none;
  font-weight: 500;
}

.map-link:hover {
  text-decoration: underline;
}

.additional-licenses {
  padding: 12px 20px;
  background: #f8fafc;
  border-top: 1px solid #e8eef5;
}

.license-divider {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .query-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .license-input-group,
  .place-input {
    max-width: 100%;
    width: 100%;
  }

  .result-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .info-row {
    flex-direction: column;
    gap: 4px;
  }

  .info-row .label {
    min-width: auto;
  }
}