/* =============================
   COMPONENTS.CSS
   Cards, Buttons, Inputs, Modals
============================= */
.cafe-card {
  background-color: #fdf7f1;
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid #e0d8cf;
  transition: transform 0.2s ease;
  text-align: center;
}

/* Coffee rating in cafe cards */
.cafe-card .coffee-display {
  justify-content: center;
  margin: 0.8rem 0;
  text-align: center;
  min-height: 2rem;
  display: flex;
  align-items: center;
}

.cafe-card .coffee-cup {
  font-size: 1.3rem;
}

/* Specific styling for cafe detail page header */
#cafe-detail .cafe-card {
  background-color: transparent;
  border: none;
  text-align: center;
  padding: 2rem 1.5rem;
}

#cafe-detail .cafe-card h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: #3e2c1c;
}

#cafe-detail .cafe-card p {
  text-align: center;
  margin: 0.5rem 0;
  font-size: 1.1rem;
}

/* Cup Quality section styling */
#cafe-detail .cup-quality-section {
  text-align: center;
  margin: 1.5rem 0 1rem 0;
  background: linear-gradient(135deg, #ffffff 0%, #fdf7f1 50%, #f8f2ea 100%);
  border-radius: 1rem;
  padding: 1.8rem 1.5rem;
  border: 1px solid #e8ddd4;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.08);
  animation: fadeInUp 0.6s ease-out;
  position: relative;
}

#cafe-detail .cup-quality-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #8b4513, #d2691e);
  border-radius: 0 0 3px 3px;
}

#cafe-detail .cup-quality-section h4 {
  font-size: 1.5rem;
  color: #3e2c1c;
  margin-bottom: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Removed cafe info intro styling - now it's a separate section */

/* Left align content sections */
#cafe-detail .form-section {
  text-align: left;
  margin-bottom: 1.5rem;
}

#cafe-detail .form-section h3 {
  text-align: left;
  margin-bottom: 0.5rem;
  color: #3e2c1c;
}

#cafe-detail .form-section ul {
  text-align: left;
  margin-left: 1rem;
}

#cafe-detail .form-section .empty-info {
  text-align: left;
}

/* Apply consistent lateral margin to entire cafe detail page */
#cafe-detail,
#cafe-location {
  padding: 0 1.5rem;
}

/* Left align review, help, and location sections */
#cafe-detail .review-section,
#cafe-detail .addInfo-section {
  text-align: left;
  margin-bottom: 2rem;
}

#cafe-detail .review-section h3,
#cafe-detail .addInfo-section h3,
#cafe-location h3 {
  text-align: left;
  margin-bottom: 1rem;
  color: #3e2c1c;
}

#cafe-detail .addInfo-section .sub {
  text-align: left;
  margin-bottom: 1rem;
}

/* Add Cafe Form Styles */
.add-cafe-form {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.form-container {
  background-color: #fdf7f1;
  border-radius: 1rem;
  padding: 2rem;
  border: 1px solid #e0d8cf;
}

.form-field {
  margin-bottom: 1.5rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #3e2c1c;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d0c4ba;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: #8b4513;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  cursor: pointer;
  padding: 0.25rem;
}

.checkbox-grid input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.preview-section {
  background-color: #f8f4f0;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #e0d8cf;
}

.preview-section h3 {
  margin-bottom: 1rem;
  color: #3e2c1c;
}

.preview-section p {
  margin-bottom: 0.5rem;
}

/* Style the review textarea */
#cafe-detail .review-section textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e0d8cf;
  border-radius: 0.7rem;
  background-color: #fdf7f1;
  font-family: inherit;
  font-size: 1rem;
  color: #3e2c1c;
  resize: vertical;
  min-height: 120px;
  margin-bottom: 1rem;
  transition: border-color 0.2s ease;
}

#cafe-detail .review-section textarea:focus {
  outline: none;
  border-color: #3e2c1c;
}

#cafe-detail .review-section textarea::placeholder {
  color: #8a7a6b;
}

/* Coffee rating system styles */
.rating-input {
  margin-bottom: 1.5rem;
}

.rating-input label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #3e2c1c;
}

.coffee-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.coffee-rating input[type="radio"] {
  display: none;
}

.coffee-rating .coffee {
  font-size: 2.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  filter: grayscale(100%);
  opacity: 0.4;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.coffee-rating .coffee:hover,
.coffee-rating .coffee:hover ~ .coffee {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.15) rotate(5deg);
  text-shadow: 0 4px 8px rgba(139, 69, 19, 0.3);
}

.coffee-rating input[type="radio"]:checked ~ .coffee {
  filter: grayscale(0%);
  opacity: 1;
  animation: coffeeGlow 0.5s ease-out;
}

@keyframes coffeeGlow {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3) rotate(10deg);
  }
  100% {
    transform: scale(1);
  }
}

#rating-display {
  font-size: 1rem;
  color: #8b4513;
  font-style: italic;
  font-weight: 500;
}

/* Review Success Message */
.review-success-message {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  padding: 1.5rem;
  border-radius: 1rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
  animation: slideInUp 0.5s ease-out, pulse 0.6s ease-in-out 0.3s;
}

.review-success-message .success-content h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.review-success-message .success-content p {
  margin: 0;
  font-size: 1rem;
  opacity: 0.95;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.review-text-input {
  margin-bottom: 1rem;
}

.review-text-input label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #3e2c1c;
}

.character-counter {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-style: italic;
  transition: color 0.2s ease;
}

/* Left align the submit button */
#cafe-detail .review-section .form-actions {
  justify-content: flex-start;
  margin-top: 0;
}

/* Modal styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(62, 44, 28, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fdf7f1;
  padding: 2rem;
  border-radius: 1.2rem;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid #e0d8cf;
  box-shadow: 0 20px 60px rgba(62, 44, 28, 0.3);
  animation: slideInUp 0.4s ease-out;
  position: relative;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h2 {
  margin-bottom: 1rem;
  color: #3e2c1c;
  text-align: center;
  font-size: 1.5rem;
}

.modal-content .sub {
  margin-bottom: 2rem;
  color: #666;
  text-align: center;
}

/* Success notification styles */
.success-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.8rem;
  box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
  z-index: 2000;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideInRight 0.4s ease-out;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.success-notification::before {
  content: "✅";
  font-size: 1.2rem;
}

.error-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #dc3545;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  animation: slideInRight 0.4s ease-out;
  max-width: 400px;
  word-wrap: break-word;
}

.info-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #17a2b8;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  animation: slideInRight 0.3s ease-out;
  max-width: 400px;
  word-wrap: break-word;
}

.error-notification::before {
  content: "❌";
  font-size: 1.2rem;
}

/* Disabled button styles */
button:disabled,
button.view-detail:disabled {
  background-color: #ccc !important;
  color: #888 !important;
  cursor: not-allowed !important;
  opacity: 0.5 !important;
  transform: none !important;
  box-shadow: none !important;
}

button:disabled:hover,
button.view-detail:disabled:hover {
  background-color: #ccc !important;
  transform: none !important;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.notification-exit {
  animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* Checkbox styling for forms */
.checkbox-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
  margin-right: 0.5rem;
  accent-color: #3e2c1c;
}

.checkbox-item label {
  cursor: pointer;
  color: #3e2c1c;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cafe-card:hover {
  transform: translateY(-4px);
}

.cafe-card h2,
.cafe-card h4 {
  margin-top: 0;
  font-size: 1.3rem;
}

button.view-detail,
a.view-detail,
button#add-info,
button#submit-review,
button[type="submit"],
button.cancel-btn,
button.sort-btn,
#submit-filters,
#close-filters {
  background-color: #3e2c1c;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
  margin-top: 1rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  min-width: fit-content;
  width: auto;
}

button.view-detail:hover,
a.view-detail:hover,
button.cancel-btn:hover,
button.sort-btn:hover,
#submit-filters:hover,
#close-filters:hover {
  background-color: #5a3d2c;
}

.show-more-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background-color: #3e2c1c;
  color: white;
  border-radius: 0.7rem;
  text-decoration: none;
  font-size: 0.9rem;
  min-width: fit-content;
  width: auto;
  text-align: center;
  white-space: nowrap;
}

input[type="text"],
input[type="number"] {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
}

/* Extra: Label cards for filters */
.filter-tag {
  background-color: #fff8f2;
  border: 1px solid #e2d8ce;
  border-radius: 0.6rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-block;
  margin: 0.2rem;
}

/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: #fdf7f1;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  margin-top: 0;
  color: #3e2c1c;
  text-align: center;
}

.modal-content .sub {
  text-align: center;
  color: #6b4f3b;
  margin-bottom: 1.5rem;
}

.form-section {
  margin-bottom: 1.5rem;
}

.form-section label {
  display: block;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #3e2c1c;
}

.form-section .radio-option {
  font-weight: normal;
}

.form-section select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e0d8cf;
  border-radius: 0.7rem;
  background: linear-gradient(135deg, #fdf7f1 0%, #f8f2ea 100%);
  font-size: 1rem;
  font-family: inherit;
  color: #3e2c1c;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(62, 44, 28, 0.1);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233e2c1c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.form-section select:focus {
  outline: none;
  border-color: #3e2c1c;
  background: linear-gradient(135deg, white 0%, #fdf7f1 100%);
  box-shadow: 0 4px 8px rgba(62, 44, 28, 0.2);
  transform: translateY(-1px);
}

.form-section select:hover {
  border-color: #8b4513;
  background: linear-gradient(135deg, white 0%, #f8f2ea 100%);
  box-shadow: 0 3px 6px rgba(62, 44, 28, 0.15);
}

/* Specific styling for roaster select - force override */
select#roaster-select,
#roaster-select {
  width: 100% !important;
  padding: 0.75rem !important;
  border: 2px solid #d0c4ba !important;
  border-radius: 0.7rem !important;
  background: #fff8f2 !important;
  font-size: 1rem !important;
  font-family: inherit !important;
  color: #3e2c1c !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  box-shadow: 0 2px 4px rgba(62, 44, 28, 0.1) !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233e2c1c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 1rem !important;
  padding-right: 2.5rem !important;
}

select#roaster-select:focus,
#roaster-select:focus {
  outline: none !important;
  border-color: #3e2c1c !important;
  background: white !important;
  box-shadow: 0 4px 8px rgba(62, 44, 28, 0.2) !important;
  transform: translateY(-1px) !important;
}

select#roaster-select:hover,
#roaster-select:hover {
  border-color: #8b4513 !important;
  background: #f8f2ea !important;
  box-shadow: 0 3px 6px rgba(62, 44, 28, 0.15) !important;
}

select#roaster-select option,
#roaster-select option {
  background-color: white !important;
  color: #3e2c1c !important;
  padding: 0.5rem !important;
}

/* Additional class-based styling */
.styled-select {
  width: 100% !important;
  padding: 0.75rem !important;
  border: 2px solid #d0c4ba !important;
  border-radius: 0.7rem !important;
  background: #fff8f2 !important;
  font-size: 1rem !important;
  font-family: inherit !important;
  color: #3e2c1c !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.form-grid label {
  background-color: #fff8f2;
  border: 1px solid #e2d8ce;
  border-radius: 0.5rem;
  padding: 0.5rem;
  cursor: pointer;
  text-align: center;
  font-weight: normal;
  transition: background-color 0.2s ease;
  margin-bottom: 0;
}

.form-grid label:hover {
  background-color: #f0e8dc;
}

.form-grid input[type="checkbox"] {
  margin-right: 0.3rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

/* Modern close button for modals */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(62, 44, 28, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #3e2c1c;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(62, 44, 28, 0.2);
  transform: scale(1.1);
}

.modal-close::before {
  content: "×";
  font-weight: bold;
}

/* Roast type radio buttons styling */
.roast-type-radios {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.radio-option {
  display: flex;
  align-items: center;
  background-color: #fff8f2;
  border: 1px solid #e2d8ce;
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-weight: normal;
  margin-bottom: 0;
  font-size: 1rem;
}

.radio-option:hover {
  background-color: #f0e8dc;
}

.radio-option input[type="radio"] {
  margin-right: 0.5rem;
  accent-color: #3e2c1c;
}

.radio-option input[type="radio"]:checked + label,
.radio-option:has(input[type="radio"]:checked) {
  background-color: #3e2c1c;
  color: white;
  border-color: #3e2c1c;
}

/* Coffee rating display styles */
.coffee-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin: 0.5rem 0;
  text-align: center;
  min-height: 2rem;
}

.coffee-cup {
  font-size: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.coffee-cup.full {
  opacity: 1;
  filter: brightness(1);
  color: #8b4513;
}

.coffee-cup.half {
  opacity: 1;
  filter: brightness(1);
  color: #8b4513;
  position: relative;
}

.coffee-cup.half::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
}

.coffee-cup.empty {
  opacity: 0.3;
  filter: grayscale(100%) brightness(0.5);
  color: #ccc;
}

/* 3-column grid matching main page layout with equal height cards */
.cafe-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Force all cafe cards to have consistent grid structure with coffee cups fixed above View Details button */
.cafe-columns .cafe-card {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 0.5rem;
  min-height: 250px;
}

.cafe-columns .cafe-card h4 {
  grid-row: 1;
  margin: 0 0 0.5rem 0;
  align-self: start;
}

/* Content area that can expand/contract */
.cafe-columns .cafe-card p:not(.coffee-display) {
  grid-row: 2;
  margin: 0;
  align-self: start;
  min-height: 1.2rem;
}

/* Coffee cups fixed in position above View Details button */
.cafe-columns .cafe-card .coffee-display {
  grid-row: 3;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  align-self: end;
}

/* View Details button fixed at bottom */
.cafe-columns .cafe-card .view-detail {
  grid-row: 4;
  align-self: end;
  justify-self: center;
  margin: 0;
}

#cafe-help h3,
#cafe-reviews h3 {
  text-align: left;
  margin-bottom: 1rem;
  color: #3e2c1c;
}

/* Reviews display styles */
.reviews-display-section {
  text-align: left;
  margin-bottom: 2rem;
}

.reviews-display-section h3 {
  text-align: left;
  margin-bottom: 1rem;
  color: #3e2c1c;
}

.review-item {
  background-color: #fdf7f1;
  border-radius: 0.8rem;
  padding: 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid #e0d8cf;
}

.review-item .review-rating {
  margin-bottom: 0.8rem;
}

.review-item .review-rating .coffee-display {
  justify-content: flex-start;
  margin: 0;
}

.review-text {
  color: #3e2c1c;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.review-date {
  font-size: 0.9rem;
  color: #6b4f3b;
  opacity: 0.8;
}

.award-item, .detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fdf7f1;
  border-radius: 0.5rem;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e0d8cf;
}

.award-name, .detail-name {
  font-weight: 500;
  color: #3e2c1c;
}

.award-votes, .detail-votes {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #6b4f3b;
}

.vote-count {
  font-weight: bold;
  color: #8b4513;
}

.vote-label {
  opacity: 0.8;
}

.details-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ========================================
   RESPONSIVE ESPECÍFICO PARA MÓVILES
   Previene tarjetas cortadas con control preciso
======================================== */

/* Mobile: Siempre 1 columna para evitar cortes */
@media (max-width: 480px) {
  .cafe-columns {
    grid-template-columns: 1fr !important;
    padding: 0 1rem;
    gap: 1rem;
    max-width: 100%;
    overflow: hidden;
  }
}

/* Mobile medium: máximo 2 columnas cuando hay espacio suficiente */
@media (min-width: 481px) and (max-width: 768px) {
  .cafe-columns {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 0 1rem;
    gap: 1rem;
    max-width: 100%;
    overflow: hidden;
  }
}

/* Fallback general para móviles */
@media (max-width: 768px) {

  .cafe-card {
    padding: 1rem;
    min-height: auto;
    border-radius: 0.8rem;
  }

  .cafe-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
    line-height: 1.25;
  }

  .cafe-card p {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .coffee-display .coffee-cup {
    font-size: 1.2rem;
  }

  /* Mobile responsive for forms */
  .add-cafe-form {
    padding: 0.5rem;
    margin: 0;
    max-width: 100%;
  }

  .form-container {
    padding: 1rem 0.8rem;
    margin: 0.3rem;
    border-radius: 0.8rem;
    background-color: #fdf7f1;
  }

  /* Mobile responsive for form sections */
  .form-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }

  /* Mobile responsive for preview content */
  .preview-section {
    padding: 1rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
  }

  .preview-section h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
  }

  .preview-section p {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
  }

  .form-section {
    margin-bottom: 1.2rem;
  }

  .form-section h3 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .checkbox-grid label {
    font-size: 0.9rem;
    padding: 0.7rem;
    text-align: left;
  }

  /* Mobile responsive for modals */
  .modal-content {
    padding: 1rem;
    margin: 0.5rem;
    max-width: calc(100vw - 1rem);
    max-height: 95vh;
    border-radius: 0.8rem;
  }

  .modal-content h2 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
  }

  .modal-content .sub {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1.5rem;
  }

  .form-actions button {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
  }

  /* Mobile responsive for cafe detail page */
  #cafe-detail,
  #cafe-location {
    padding: 0 1rem;
  }

  #cafe-detail .cafe-card {
    padding: 1rem 1rem;
  }

  #cafe-detail .cafe-card h2 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin-bottom: 0.8rem;
  }

  #cafe-detail .cafe-card p {
    font-size: 0.95rem;
    margin: 0.3rem 0;
  }

  #cafe-detail .cup-quality-section {
    padding: 1.2rem 0.8rem;
    margin: 1rem 0;
  }

  #cafe-detail .cup-quality-section h4 {
    font-size: 1.2rem;
  }

  #cafe-detail .form-section {
    margin-bottom: 1.2rem;
  }

  #cafe-detail .form-section h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
  }

  #cafe-detail .form-section ul {
    margin-left: 0.8rem;
  }

  #cafe-detail .form-section li {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
  }

  /* Mobile responsive for reviews */
  .review-item {
    padding: 1rem;
    margin-bottom: 0.8rem;
  }

  .review-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .review-date {
    font-size: 0.8rem;
  }

  /* Mobile responsive for award/detail items */
  .award-item, .detail-item {
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.4rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .award-name, .detail-name {
    font-size: 0.9rem;
  }

  .award-votes, .detail-votes {
    font-size: 0.8rem;
  }

  /* Mobile responsive for rating system */
  .coffee-rating .coffee {
    font-size: 1.8rem;
  }

  /* Mobile responsive for review section */
  #cafe-detail .review-section textarea {
    font-size: 1rem;
    min-height: 100px;
  }

  /* Mobile responsive for buttons */
  button.view-detail,
  a.view-detail,
  .show-more-btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
  }

  /* Mobile responsive for form fields */
  .form-field {
    margin-bottom: 1.2rem;
  }

  .form-field label {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
  }

  .form-field input,
  .form-field select,
  .form-field textarea {
    padding: 0.8rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    width: 100%;
    box-sizing: border-box;
  }

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

  /* Mobile responsive for checkboxes */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .form-grid label {
    text-align: left;
    padding: 0.8rem;
    font-size: 0.9rem;
    border-radius: 0.5rem;
  }

  /* Mobile responsive for roast type radios */
  .roast-type-radios {
    flex-direction: column;
    gap: 0.6rem;
  }

  .radio-option {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  /* Mobile responsive for buttons */
  button.view-detail,
  a.view-detail,
  .show-more-btn {
    padding: 0.8rem 1rem;
    font-size: 1rem;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* Mobile responsive for notifications */
  .success-notification,
  .error-notification,
  .info-notification {
    right: 5px;
    left: 5px;
    top: 10px;
    max-width: calc(100vw - 10px);
    width: auto;
    font-size: 0.9rem;
    padding: 0.8rem 1rem;
  }
}

/* Extra small devices (Samsung Galaxy S25 y similares) */
@media (max-width: 360px) {
  .cafe-columns {
    grid-template-columns: 1fr !important;
    padding: 0 0.8rem;
    gap: 0.8rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .cafe-card {
    padding: 1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Samsung Galaxy S23 y dispositivos de alta resolución */
@media (max-width: 430px) and (min-device-pixel-ratio: 3) {
  .cafe-columns {
    grid-template-columns: 1fr !important;
    padding: 0 1rem;
    gap: 1rem;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }
  
  .cafe-card {
    padding: 1.1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Samsung Galaxy S23 Ultra y dispositivos similares */
@media (max-width: 430px) and (min-height: 900px) {
  .cafe-columns {
    grid-template-columns: 1fr !important;
    padding: 0 1.1rem;
    gap: 1.1rem;
    max-width: 100%;
    overflow: hidden;
  }
  
  .cafe-card {
    padding: 1.2rem;
    border-radius: 1rem;
  }
}

/* Breakpoint específico para viewport real del Samsung S23 */
@media (max-width: 393px) {
  .cafe-columns {
    grid-template-columns: 1fr !important;
    padding: 0 1rem;
    gap: 1rem;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }
}

/* ===== FORMULARIOS Y MODALES FLUIDOS ===== */
  .add-cafe-form {
    padding: clamp(0.3rem, 2vw, 1rem);
  }

  .form-container {
    padding: clamp(0.8rem, 3vw, 1.5rem);
    margin: clamp(0.2rem, 1vw, 0.5rem);
    border-radius: clamp(0.8rem, 2vw, 1rem);
  }

  .modal-content {
    padding: clamp(0.8rem, 3vw, 1.5rem);
    margin: clamp(0.3rem, 1vw, 0.5rem);
    border-radius: clamp(0.8rem, 2vw, 1rem);
  }

  /* ===== BOTONES CON TOUCH TARGETS OPTIMIZADOS ===== */
  button.view-detail,
  a.view-detail,
  .show-more-btn {
    padding: clamp(0.7rem, 3vw, 1rem) clamp(0.8rem, 4vw, 1.2rem);
    font-size: clamp(0.9rem, 3vw, 1rem);
    min-height: 44px; /* Touch target universal */
    border-radius: clamp(0.6rem, 2vw, 0.8rem);
  }

/* Medium devices (small tablets/large phones in landscape) */
@media (min-width: 415px) and (max-width: 768px) {
  .cafe-columns {
    padding: 0 1.3rem;
    gap: 1.2rem;
  }

  .cafe-card {
    padding: 1.2rem;
  }
}

/* Tablet responsive styles */
@media (max-width: 1024px) and (min-width: 769px) {
  .cafe-columns {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 1.5rem;
    gap: 1.5rem;
  }

  .add-cafe-form {
    padding: 1.5rem;
  }

  .checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-content {
    max-width: 80vw;
  }

  #cafe-detail,
  #cafe-location {
    padding: 0 1.5rem;
  }
}

/* Mobile map optimizations */
@media (max-width: 768px) {
  .map-container {
    height: 250px;
    min-height: 200px;
    border-radius: 12px; /* iOS design language */
    -webkit-transform: translate3d(0,0,0); /* Hardware acceleration */
  }
}