/* ------------------------------
   Global Styles (Dark Mode Base)
------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background-color: #121212;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0 auto;
  padding: 12px 12px 88px; /* bottom clears the fixed FAB */
  max-width: 700px;
}

@media (min-width: 480px) {
  body {
    padding: 20px 20px 88px;
  }
}

h1, h2 {
  text-align: center;
  color: #ffffff;
}

/* ------------------------------
   Inputs & Textareas
------------------------------ */
input, textarea {
  margin: 5px 0;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem;
  background-color: #1e1e1e;
  border: 1px solid #444;
  color: #fff;
  border-radius: 6px;
}

/* ------------------------------
   Buttons
------------------------------ */
button {
  padding: 10px 18px;
  margin-top: 10px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background-color: #333;
  color: #fff;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  transition: background 0.3s;
  -webkit-tap-highlight-color: transparent;
}

button:hover {
  background-color: #555;
}

button:active {
  background-color: #666;
}

/* Back navigation button */
.back-button {
  width: auto;
  max-width: none;
  padding: 8px 16px;
  font-size: 0.95rem;
  background-color: #2a2a2a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

#buttonRow {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 12px 0;
  flex-wrap: nowrap;
}

.round-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #444;
  color: #fff;
  font-size: 1.2rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.round-button:hover {
  background-color: #666;
}

#toggleFormBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #e63946;
  color: white;
  font-size: 1.6rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------
   Navigation A–Z
------------------------------ */
#alphabetNav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin: 10px 0;
}

.az-button {
  padding: 0;
  font-size: 0.85rem;
  border: 1px solid #444;
  background-color: #222;
  color: #eee;
  border-radius: 4px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  max-width: none;
  margin: 0;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.az-button:hover {
  background-color: #444;
}

.az-button:active {
  background-color: #555;
}

/* ------------------------------
   Search Field Animation
------------------------------ */
.search-wrapper {
  display: flex;
  justify-content: center;
  position: relative;
  margin-bottom: 10px;
}

.search-wrapper input {
  width: 0;
  opacity: 0;
  transition: all 0.3s ease;
  padding: 10px;
  font-size: 1rem;
  border-radius: 20px;
  border: 1px solid #444;
  background-color: #1e1e1e;
  color: #fff;
}

.search-wrapper input.active {
  width: 90%;
  max-width: 300px;
  opacity: 1;
}

@media (max-width: 480px) {
  .search-wrapper input.active {
    width: 96%;
    max-width: none;
  }
}

/* ------------------------------
   Cards
------------------------------ */
.cocktail-toggle {
  border: 1px solid #333;
  border-radius: 8px;
  margin: 8px 12px;
  background-color: #1e1e1e;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.cocktail-header {
  background-color: #2a2a2a;
  padding: 12px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #eee;
  cursor: pointer;
}

.cocktail-header em {
  font-style: normal;
  font-weight: normal;
  font-size: 0.9rem;
  color: #aaa;
}

.cocktail-content {
  padding: 0 12px;
  transition: padding 0.3s ease, max-height 0.3s ease;
  color: #ddd;
  max-height: 0;
  overflow: hidden;
}

.cocktail-content.expanded {
  padding: 12px;
  max-height: 1000px;
}

/* ------------------------------
   Cocktail Action Buttons (Edit / Delete)
------------------------------ */
.cocktail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid #2e2e2e;
}

.edit-button,
.delete-button {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  font-size: 1.1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.edit-button {
  background-color: #2a4a7f;
  color: #fff;
}

.edit-button:hover {
  background-color: #3a6aaf;
}

.delete-button {
  background-color: #7f2a2a;
  color: #fff;
}

.delete-button:hover {
  background-color: #af3a3a;
}

.edit-button:active {
  background-color: #4a80cf;
}

.delete-button:active {
  background-color: #cf4a4a;
}

.cocktail-grid {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.cocktail-grid .left,
.cocktail-grid .right {
  flex: 1 1 0;
  min-width: 200px;
}

@media (max-width: 480px) {
  .cocktail-grid {
    flex-direction: column;
  }

  .cocktail-grid .left,
  .cocktail-grid .right {
    min-width: unset;
  }
}

/* ------------------------------
   Cocktail Image
------------------------------ */
.cocktail-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #444;
  background: #222;
  display: block;
}

/* ------------------------------
   Filter & Tag Checkboxes – Pill chips
------------------------------ */
#categoryFilters,
#tagCheckboxes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}

#categoryFilters fieldset,
#tagCheckboxes fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#categoryFilters legend,
#tagCheckboxes legend {
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  padding: 0;
  margin-bottom: 2px;
}

/* Hide native checkbox */
#categoryFilters label input[type="checkbox"],
#tagCheckboxes label input[type="checkbox"] {
  display: none;
}

/* Pill chip */
#categoryFilters label,
#tagCheckboxes label {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #444;
  background: #2a2a2a;
  cursor: pointer;
  font-size: 0.9rem;
  color: #ccc;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  width: auto;
  max-width: none;
}

#categoryFilters label:hover,
#tagCheckboxes label:hover {
  background: #3a3a3a;
  border-color: #666;
  color: #fff;
}

/* Selected state */
#categoryFilters label:has(input:checked),
#tagCheckboxes label:has(input:checked) {
  background: #e63946;
  border-color: #e63946;
  color: #fff;
}

#categoryFilters label:has(input:checked):hover,
#tagCheckboxes label:has(input:checked):hover {
  background: #c72d39;
  border-color: #c72d39;
}
