/*
 *= require active_admin/base
*/

/* === Ogólny wygląd panelu admina === */
body.active_admin {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: #f8f9fb;
  color: #222;
}

h3, h2 {
  font-weight: 600;
  color: #1e293b;
}

/* === Panele === */
.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  padding: 16px;
}

.panel > h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  text-transform: uppercase;
  color: #334155;
}

/* === Tabele === */
.panel table,
.index_table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
}

.panel table th,
.index_table th {
  background-color: #f3f4f6;
  color: #374151;
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.panel table td,
.index_table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel table tr:nth-child(even),
.index_table tr:nth-child(even) {
  background-color: #fafafa;
}

/* === Miniatury / Obrazy === */
.admin-thumbnail {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: inline-block;
  margin: 4px;
}

.no-image {
  display: inline-block;
  font-size: 12px;
  color: #9ca3af;
  background: #f3f4f6;
  border-radius: 4px;
  padding: 4px 6px;
  margin: 2px;
}

.admin-images-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* === Formularze === */
input[type="text"],
input[type="email"],
input[type="file"],
textarea,
select {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  transition: all 0.15s ease-in-out;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 3px rgba(37, 99, 235, 0.3);
  outline: none;
}

/* === Główne przyciski === */
a.button, input[type=submit].button {
  background-color: #2563eb;
  color: white !important;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

a.button:hover, input[type=submit].button:hover {
  background-color: #1d4ed8;
}

/* === POLA TŁUMACZEŃ === */
.translation-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.translation-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.3rem 0;
}

.translation-locale-label {
  font-size: 0.75rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.translation-input {
  width: 100%;
  min-width: 180px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
  background-color: #fff;
}

.translation-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.translation-textarea {
  min-height: 100px;
  resize: vertical;
}

.translation-textfield {
  height: 32px;
}

/* Kolory tła wg języka */
.translation-input[placeholder="pl"] { background-color: #f0f8ff; }
.translation-input[placeholder="en"] { background-color: #f9fff0; }
.translation-input[placeholder="de"] { background-color: #fff9f0; }

/* === Przycisk View / Edit / Delete === */
a.view_link,
a.edit_link,
a.delete_link {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 5px;
  text-decoration: none;
  color: white;
  margin: 2px;
  transition: all 0.2s ease;
}

a.view_link { background-color: #0ea5e9; }
a.view_link:hover { background-color: #0284c7; }

a.edit_link { background-color: #16a34a; }
a.edit_link:hover { background-color: #15803d; }

a.delete_link { background-color: #dc2626; }
a.delete_link:hover { background-color: #b91c1c; }

/* === Przycisk zbiorczy akcji (u góry tabeli) === */
.action_items a {
  background-color: #2563eb;
  color: white !important;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}
.action_items a:hover {
  background-color: #1e40af;
}

/* === Przyciski akcji przy rekordach === */
.member_link {
  margin: 0 2px;
}

/* === Dodatkowe elementy === */
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }

/* === DASHBOARD (kafelki modeli) === */

.columns {
  display:flex;
  flex-direction: row;
  flex-wrap: wrap;
}
.column {
  display: flex;
}

.admin_dashboard {
  gap: 20px;
  padding: 20px;
}

.admin_dashboard .panel {
background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  width: 100%;
}

.admin_dashboard .panel:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.admin_dashboard .panel h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1e3a8a;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.admin_dashboard .panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin_dashboard .panel ul li {
  margin-bottom: 6px;
}

.admin_dashboard .panel ul li a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.admin_dashboard .panel ul li a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .columns {
    flex-direction: column; /* kolumny jedna pod drugą */
  }

  div.column {
    width: 100%; /* każda zajmuje całą szerokość */
    margin-bottom: 20px; /* odstęp między kolumnami */
  }

  .admin_dashboard .panel {
    width: 100% !important; /* panel dopasowuje się do kolumny */
  }
}

/* Pasek nagłówka ActiveAdmin */
.header {
  display: flex;
  justify-content: space-between; /* tytuł po lewej, reszta po prawej */
  align-items: center;
  padding: 8px 16px;
  background-color: #2d4085; /* ciemnoniebieski pasek */
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Nazwa strony / tytuł */
.header .site_title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffffff;
  text-transform: uppercase;
}
.header ul li {
  list-style: none;
}

/* Kontener elementów po prawej stronie: user, logout, komentarze */
.header {
  display: flex;
  align-items: center;
  gap: 12px; /* odstęp między elementami */
}

/* Linki / przyciski po prawej */
.header a,
.header span {
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.header a:hover,
.header span:hover {
  background-color: rgba(255,255,255,0.15);
}

/* Jeśli w headerze są ikony komentarzy */
.header .comments {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
}

/* === Translation Tabs === */
.translation-tabs {
  display: flex;
  flex-direction: column;
}

.tab-label {
  display: inline-block;
  padding: 4px 8px;
  margin-right: 2px;
  background-color: #eee;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.tab-label:hover { background-color: #ddd; }

.tab-content {
  display: none;
  padding: 8px;
  border: 1px solid #ccc;
  border-top: none;
}

input[type="radio"]:checked + .tab-label + .tab-content {
  display: block;
}
