@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap");

:root {
  --primary: #0073aa;
  --primary-dark: #005177;
  --text: #333;
  --bg: #f9f9f9;
  --radius: 8px;
  --font: "Inter", sans-serif;
}

/* ===== Root Container ===== */
#lsc-search {
  background: var(--bg);
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 20px;
  font-family: var(--font);
  margin: 30px auto;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* ===== Search Input ===== */
#lsc-keyword {
  width: calc(100% - 46px);
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  display: inline-block;
  margin-bottom: 10px;
}

#lsc-voice-btn {
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 50%;
  padding: 10px;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 6px;
}

#lsc-voice-btn.listening {
  background: red;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

/* ===== Filters (Chips) ===== */
#lsc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 15px;
}

#lsc-filters label {
  background: #eee;
  padding: 6px 12px;
  border-radius: 30px;
  font-size: 0.85em;
  cursor: pointer;
  border: 1px solid #ccc;
  transition: all 0.2s ease;
}

#lsc-filters input[type="checkbox"] {
  margin-right: 5px;
}

/* ===== Suggested Keywords ===== */
#lsc-suggested-keywords {
  margin-bottom: 10px;
}

.lsc-suggestion {
  background: #e0e0e0;
  border: none;
  border-radius: 30px;
  padding: 6px 14px;
  font-size: 0.85em;
  margin: 5px 5px 0 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lsc-suggestion:hover {
  background: var(--primary);
  color: white;
}

/* ===== Loading & Controls ===== */
#lsc-loading {
  font-size: 0.9em;
  color: var(--text);
  margin-bottom: 10px;
}

.lsc-spinner::after {
  content: "⏳";
  animation: spin 1s linear infinite;
}

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

#lsc-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  flex-wrap: wrap;
  gap: 10px;
}

#lsc-stop-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 14px;
  font-size: 0.9em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}

#lsc-stop-btn:hover {
  background: #b52b34;
}

#lsc-status-count {
  font-size: 0.9em;
  color: #666;
}

/* ===== Result List ===== */
.lsc-result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .lsc-result-list {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== Result Item ===== */
.lsc-item {
  background: white;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  padding: 15px;
  transition: box-shadow 0.2s ease;
}

.lsc-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.lsc-item a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.05em;
}

.lsc-item a:hover {
  text-decoration: underline;
}

.lsc-meta {
  font-size: 0.85em;
  color: #777;
  margin-top: 6px;
  display: block;
}

.lsc-type {
  padding: 2px 8px;
  font-size: 0.75em;
  color: white;
  border-radius: 999px;
  text-transform: capitalize;
  margin-right: 6px;
  display: inline-block;
}

/* Type colors */
.lsc-type.Post {
  background: #3f51b5;
}
.lsc-type.Page {
  background: #009688;
}
.lsc-type.Dokumen {
  background: #d32f2f;
}
.lsc-type.Word {
  background: #1976d2;
}
.lsc-type.Excel {
  background: #388e3c;
}

.lsc-source {
  font-weight: bold;
}

/* ===== Thumbnail ===== */
.lsc-thumb {
  width: 100%;
  max-width: 120px;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: none;
}

/* ===== Snippet ===== */
.lsc-snippet {
  display: block;
  margin-top: 8px;
  color: #444;
  font-size: 0.95em;
}