/* Custom styles for the Recipe Sharing App */

/* Recipe cards hover effect */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Ingredient checklist styling */
.ingredients-list .form-check-label {
    cursor: pointer;
    transition: text-decoration 0.2s ease;
}

.ingredients-list .form-check-input:checked + .form-check-label {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Instruction steps styling */
.instruction-step {
    transition: background-color 0.2s ease;
}

.instruction-step:hover {
    background-color: var(--bs-secondary-bg);
}

/* Recipe info cards */
.card-body .fa-2x {
    color: var(--bs-primary);
}

/* Badge styling */
.badge {
    font-size: 0.75em;
}

/* Search form styling */
.input-group .form-control:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Navigation improvements */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Footer styling */
footer {
    margin-top: auto;
}

/* Form improvements */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Button improvements */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Pagination styling */
.pagination .page-link {
    color: var(--bs-primary);
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Alert improvements */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Search card needs proper stacking context for dropdowns */
.card {
    position: relative;
    z-index: 1;
}

.card:has(form[method="GET"]) {
    z-index: 100;
}

/* Dropdown menu improvements for filter dropdowns */
.dropdown {
    position: relative;
}

.dropdown-menu {
    background-color: rgba(var(--bs-dark-rgb), 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000 !important;
    position: absolute !important;
}

.dropdown-menu.show {
    z-index: 1000 !important;
}

.dropdown-menu .form-check-label {
    color: var(--bs-body-color);
}

.dropdown-menu .form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Modal improvements */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}

/* Loading animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--bs-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .jumbotron {
        padding: 2rem 1rem !important;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
}

/* Print styles for recipes */
@media print {
    .navbar,
    .btn,
    .card-footer,
    footer {
        display: none !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    .ingredients-list .form-check-input {
        display: none;
    }
    
    .instruction-step {
        border: 1px solid #dee2e6 !important;
        break-inside: avoid;
    }
}
