/* --- EXISTING STYLES (Kept & Cleaned) --- */

.number-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 20px;
}

.number-btn {
  width: 6rem;
  height: 6rem;
  font-size: 3rem;
  border: none;
  border-radius: 50%;
  background: #333;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
}

.number-btn:active {
  background: #555;
}

.number-display {
  font-size: 4rem;
  width: 9.5rem;
  text-align: center;
  appearance: textfield;
  flex: 1;
}

.number-display::-webkit-outer-spin-button,
.number-display::-webkit-inner-spin-button {
  display: none
}

.auth-notice {
  display: none; /* Toggled via JS */
  padding: 10px;
  background: #e3f2fd;
  border-radius: 8px;
  margin-bottom: 20px;
  align-items: center; /* Added to align text/button */
}

/* Reusing your existing Header class, but effectively */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header h1 {
  margin: 0;
}

.settings-link {
  font-size: 28px;
  text-decoration: none;
  line-height: 1;
}

/* --- NEW: Button Utilities --- */

.btn-logout {
  margin-left: 10px;
  padding: 4px 12px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  cursor: pointer;
}

.btn-add-new {
  padding: 12px 16px;
  background: #000;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 16px;
}

/* --- Category Layout --- */

.category-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.category-picker {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  /* Removed bottom margin so it sits flush in the flex row */
  margin-bottom: 0; 
}

/* If inside a row, make it stretch */
.category-row .category-picker {
  flex: 1;
}

/* --- Camera & Form Components --- */

.camera-btn {
  width: 100%;
  padding: 20px;
  background: #000;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

.camera-input { display: none; }

.preview {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
}

.rating-container { margin-bottom: 20px; }
.rating-slider { width: 100%; height: 40px; }
.rating-display {
  text-align: center;
  font-size: 24px;
  margin: 10px 0;
  visibility: hidden;
}
    
.back-btn {
  padding: 12px 24px;
  background: white;
  color: #000;
  border: 2px solid #000;
  border-radius: 8px;
  text-decoration: none;
  display: inline-block;
}

.category-filter {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
}

.rating-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  background: white;
}

.rating-item img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 10px;
}

.rating-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rating-stars {
  font-size: 20px;
}

.rating-category {
  color: #666;
  font-size: 14px;
  text-transform: capitalize;
}

.rating-date {
  color: #999;
  font-size: 12px;
  margin-top: 5px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.delete-btn {
  padding: 8px 16px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.delete-btn:hover {
  background: #cc0000;
}
    
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid #ddd;
}

.setting-info h3 {
  margin-bottom: 5px;
}

.setting-info p {
  color: #666;
  font-size: 14px;
}

.toggle {
  position: relative;
  width: 50px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
    
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #000;
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.save-btn {
  width: 100%;
  padding: 16px;
  background: #000;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  margin-bottom: 10px;
}
.save-btn:disabled { background: #ccc; cursor: not-allowed; }

.view-ratings-btn {
  width: 100%;
  padding: 16px;
  background: white;
  color: #000;
  border: 2px solid #000;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

.view-ratings-btn.login-trigger {
  display: none; /* Toggled via JS */
  margin-bottom: 10px;
}

.modal-overlay {
  display: none; /* Hidden by default, JS turns this to 'flex' */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  
  /* These center the card explicitly */
  align-items: center;
  justify-content: center;
}

.modal-title {
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center; /* Optional: centers the "Log In" text */
}

.form-input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin-bottom: 15px;
  box-sizing: border-box; /* Important: keeps padding from breaking width */
}

.modal-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  
  /* This ensures the content inside stacks nicely */
  display: flex;
  flex-direction: column;
}

/* --- Button Container --- */
.modal-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

/* --- Buttons --- */
/* Primary (Continue/Add) */
.btn-primary {
  flex: 1;
  padding: 12px;
  background: #000;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  font-weight: bold;
}

/* Secondary (Cancel) */
.btn-secondary {
  padding: 12px 20px;
  background: white;
  border: 2px solid #000;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
}

/* --- Magic Link Text --- */
.text-link-center {
  text-align: center;
}

.text-link {
  color: #666;
  font-size: 14px;
  text-decoration: none;
}

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

.warning-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ff9800;
  color: white;
  padding: 16px;
  text-align: center;
  display: none;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.warning-banner button {
  margin: 10px 5px 0;
  padding: 8px 20px;
  background: white;
  color: #ff9800;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.warning-banner .dismiss {
  background: transparent;
  color: white;
}

.sort-wrapper {
  margin-bottom: 20px;
  text-align: center;
}

.btn-sort {
  padding: 10px 20px;
  background: white;
  border: 2px solid #000;
  border-radius: 8px;
  cursor: pointer;
}

.map-link {
  margin-left: 5px;
  text-decoration: none;
}