/* assets/css/rating.css */

/* Use the new style guide variables */
:root {
  --primary-color: #ff6b35;
  --secondary-color: #f54500;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --text-dark: #212529;
  --text-light: #6c757d;
  --border-color: #e9ecef;
  --transition: all 0.3s ease-in-out;
  --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  --star-color: #adb5bd; /* Unselected star */
  --star-color-active: #fcc419; /* Selected star */
}

/* ===================================================================
   FOOD CARD REDESIGN (Category & Recommended)
   - Image set to 80-90% height
   =================================================================== */

.food-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column; /* Stack image and content */
  height: 100%;
  background: var(--bg-white);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-dark);
}

.food-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

/* This is the key part for the 80-90% image */
.card-image,
.food-card-image {
  flex-basis: 250px; /* Base height, will grow */
  flex-grow: 1; /* This makes it take up the extra space */
  position: relative;
  overflow: hidden;
}

.card-image img,
.food-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This ensures the image is "full-sized" and covers the area */
  display: block;
  transition: var(--transition);
}

.food-card:hover img {
  transform: scale(1.05);
}

/* This will be the 10-20% at the bottom */
.card-content,
.food-card-content {
  flex-grow: 0;
  flex-shrink: 0; /* Don't let it shrink */
  padding: 1rem;
}

.card-content h3,
.food-card-content h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--text-dark);
}
.food-card:hover h3,
.food-card:hover h4 {
  color: var(--primary-color);
}

.card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

.special-badge {
  background-color: var(--secondary-color);
  color: var(--bg-white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ===================================================================
   READ-ONLY STAR RATING (For display)
   =================================================================== */

.food-card-rating,
.food-details-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.star-rating {
  --percent: calc(var(--rating, 0) / 5 * 100%);
  display: inline-block;
  font-size: 1.1rem;
  font-family: Times; /* Default, nice stars */
  line-height: 1;
}
.star-rating::before {
  content: "★★★★★";
  letter-spacing: 1px;
  background: linear-gradient(
    90deg,
    var(--star-color-active) var(--percent),
    var(--star-color) var(--percent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rating-count,
.rating-count-small {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.food-details-rating {
  margin: 1rem 0;
}
.food-details-rating .star-rating {
  font-size: 1.5rem;
}
.food-details-rating .rating-count {
  font-size: 1.1rem;
}

/* ===================================================================
   INTERACTIVE STAR RATING (For input)
   =================================================================== */

.star-rating-input {
  display: inline-flex;
  flex-direction: row-reverse; /* This is the trick! */
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.star-rating-input input[type="radio"] {
  display: none; /* Hide the radio button */
}

.star-rating-input label {
  font-size: 2rem;
  color: var(--star-color);
  cursor: pointer;
  padding: 0 0.1em;
  transition: var(--transition);
}
.star-rating-input label::before {
  content: "★";
}

/* This is where the magic happens */
.star-rating-input input[type="radio"]:checked ~ label, /* All following labels */
.star-ring-input label:hover, /* On hover */
.star-rating-input label:hover ~ label /* All following labels on hover */ {
  color: var(--star-color-active);
}

.rating-message {
  font-size: 0.9rem;
  min-height: 1.2em;
  transition: var(--transition);
}
.rating-message.success {
  color: var(--success-color);
}
.rating-message.error {
  color: var(--danger-color);
}