html { font-size: 14px; }

@media (min-width: 768px) {
    html { font-size: 16px; }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus { box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb; }

html { position: relative; min-height: 100%; }

body { margin-bottom: 60px; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder { color: var(--bs-secondary-color); text-align: end; }

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder { text-align: start; }

label + input:checked { text-decoration: line-through; }

/* Recipe card styles */
.recipe-card {
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.recipe-card .card-body {
    flex: 1 1 auto;
}

.recipe-card .card-footer {
    flex-shrink: 0;
}

.recipe-card-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.recipe-card-image {
    height: 200px;
    object-fit: cover;
    width: 100%;
    background-color: #f8f9fa;
}

.recipe-card-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
}

/* Show placeholder when image fails or no Unsplash result */
.recipe-card-image-wrapper.has-error .recipe-card-placeholder,
.recipe-card-image-wrapper.show-placeholder .recipe-card-placeholder,
.recipe-card-image-wrapper.show-placeholder-always:not(:has(img)) .recipe-card-placeholder {
    display: flex;
}

/* Detail page image */
.recipe-detail-image-wrapper {
    position: relative;
    min-height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
}

.recipe-detail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 8rem;
    border-radius: 0.375rem;
}

/* Show placeholder when image fails or no Unsplash result */
.recipe-detail-image-wrapper.has-error .recipe-detail-placeholder,
.recipe-detail-image-wrapper.show-placeholder .recipe-detail-placeholder,
.recipe-detail-image-wrapper.show-placeholder-always:not(:has(img)) .recipe-detail-placeholder {
    display: flex;
}

/* Image loading states */
img[loading="lazy"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Smooth fade-in for loaded images */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.recipe-card-image,
.recipe-detail-image {
    animation: fadeIn 0.3s ease-in;
}
