/* Spinner Styling */
.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #ccc;
    border-top: 4px solid #4caf50; /* Accent color */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading container animation */
.zestful-loading {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    animation: pulseBg 2s ease-in-out infinite;
}

@keyframes pulseBg {
    0% { background-color: #fafafa; }
    50% { background-color: #f0fff4; }
    100% { background-color: #fafafa; }
}

/* --------------------------------------------------------------------
 * Skeleton styles for front‑end loading state
 *
 * These classes create a shimmering placeholder that occupies the same
 * footprint as the final recipe card.  They are injected into the DOM
 * when a recipe request is submitted and removed once the image loads.
 */
.zestful-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    max-width: 860px;
    margin: 16px auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

/* Skeleton elements mimic the aspect ratios of the final content. */
.zestful-skel-img {
    width: 100%;
    height: 360px;
    border-radius: 12px;
    background: #f0f2f5;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}
.zestful-skel-title {
    height: 20px;
    width: 60%;
    border-radius: 6px;
    background: #f0f2f5;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}
.zestful-skel-lines {
    height: 10px;
    width: 100%;
    border-radius: 6px;
    background: #f0f2f5;
    margin: 6px 0;
    position: relative;
    overflow: hidden;
}

/* Shimmer effect for skeletons */
.shimmer {
    position: relative;
    overflow: hidden;
}
.shimmer::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    height: 100%;
    width: 150%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .6) 50%, rgba(255, 255, 255, 0) 100%);
    animation: zestful-shimmer 1.25s infinite;
}

@keyframes zestful-shimmer {
    0%   { left: -150%; }
    100% { left: 150%; }
}

/* Responsive adjustments for hero image placeholder height */
@media (min-width: 1200px) {
    .zestful-skel-img { height: 440px; }
}
@media (min-width: 1440px) {
    .zestful-skel-img { height: 520px; }
}
