/* =========================================
   0) RESET / BASE
   Tikslas: tvarkinga bazė, kad viskas skaičiuotųsi normaliai
========================================= */

* {
  box-sizing: border-box;
}

body {
  margin:0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f2f2f2;
  color:#202124;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
}

h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 32px;
}

.top-actions {
  width: 100%;
  max-width: 700px;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

#logout-btn {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #dfe1e5;
  background-color: #fff;
  color: #202124;
  cursor: pointer;
}

#logout-btn:hover {
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
}

/* =========================================
   1) LAYOUT
   Tikslas: vienas centrinis wrapperis su max-width
========================================= */

.search-wrapper {
  width: 100%;
  max-width: 700px; /* kad ant didelio ekrano nebūtų per platu */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

#result {
  width: 100%;
  max-width: 700px;
  margin-top: 16px;
}

/* =========================================
   2) checkbox
   Tikslas: vienoje eilėje, input užima likutį plotį
========================================= */
.fetch-data{
  width: 100%;
  max-width: 700px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 32px;
  margin-bottom: 24px;
}

.fetch-data label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.fetch-data input[type="checkbox"] {
  cursor: pointer;
}

/* =========================================
   2) FORM (input + button)
   Tikslas: vienoje eilėje, input užima likusį plotį
========================================= */

#artist-form {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#artist-input {
  flex: 1; /* užima visą įmanomą plotį */
  padding: 14px 18px; /* aukštis: padidini – baras aukštesnis */
  font-size: 16px;
  border-radius: 999px; /* pill formos */
  border: 1px solid #dfe1e5;
  background-color: white;
  outline: none;
  box-shadow: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease;
}

#artist-input:hover {
  background-color: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
  border-color: transparent;
}

#artist-input:focus {
  background-color: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.35);
  border-color: #4285f4; /* mėlynas border kaip Google */
}

/* =========================================
   Filter Input
========================================= */
.filter-wrapper {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
}

#filter-input {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid #dfe1e5;
  background-color: white;
  outline: none;
  box-shadow: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

#filter-input:hover {
  background-color: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
  border-color: transparent;
}

#filter-input:focus {
  background-color: #fff;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.35);
  border-color: #4285f4;
}

#artist-form button {
  padding: 10px 18px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid #dfe1e5;
  background-color: #f8f9fa;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease,
    border-color 0.15s ease;
}

#artist-form button:hover {
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
  border-color: #dfe1e5;
}

#artist-form button:active {
  background-color: #e8eaed;
  box-shadow: none;
}

/* =========================================
   3) RESULTS TABLE
   Tikslas: "card" lentelė su apvaliais kampais
========================================= */

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.2);
}

.results-table thead {
  background-color: #f1f3f4;
}

.results-table th,
.results-table td {
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;       
}

.results-table thead {
  background-color: #f1f3f4;
}

.results-table tbody tr:last-child td {
  border-bottom: none;
}

/* Scrollable container for long results lists (caps height to ~600px, shows scrollbar if needed) */
.results-container {
  max-height: 720px; /* increased to show ~12 rows */
  overflow-y: auto;
  border-radius: 12px;
}

/* --- Stulpelių lygiavimas (praktika su :first-child ir :nth-child) --- */

/* 1 stulpelis: avataras */
.results-table th:first-child,
.results-table td:first-child {
  width: 72px;
  text-align: center;
}

/* 2 stulpelis: artist kairėje */
.results-table th:nth-child(2),
.results-table td:nth-child(2) {
  text-align: right;
}

/* 3 ir 4: skaičiai dešinėje */
.results-table th:nth-child(3),
.results-table td:nth-child(3),
.results-table th:nth-child(4),
.results-table td:nth-child(4) {
  text-align: right;
}

/* Avataro img */
.artist-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin: 0 auto;  /* 👈 centras ląstelėje */
}

/* =========================================
   Delete Button
========================================= */
.delete-btn {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  border: 1px solid #dfe1e5;
  background-color: #fff;
  color: #d33b27;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  font-weight: 500;
}

.delete-btn:hover {
  background-color: #fce8e6;
  border-color: #d33b27;
  box-shadow: 0 1px 3px rgba(211, 59, 39, 0.2);
}

.delete-btn:active {
  background-color: #f4c7c3;
  box-shadow: none;
}

/* =========================================
   History Section
========================================= */
.history-wrapper {
  padding: 16px;
}

.history-chart-wrapper {
  margin-bottom: 24px;
  background-color: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.1);
}

.history-chart-wrapper canvas {
  max-height: 300px;
}

.history-table-wrapper {
  margin-top: 16px;
}

/* =========================================
   Loading Bar
========================================= */
#loading-container {
  width: 100%;
  max-width: 700px;
  margin-top: 16px;
}

.loading-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: #5f6368;
}

#current-artist {
  font-weight: 500;
  color: #202124;
}

#artist-count {
  font-size: 13px;
}

.loading-bar {
  width: 100%;
  height: 6px;
  background-color: #e8eaed;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(32, 33, 36, 0.1);
}

#progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4285f4, #34a853);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 999px;
}