/* =====================================================================
   FORM COMPONENTS
   ---------------------------------------------------------------------
   Shared form styles for contact, reservation, review and authentication
   flows. Consolidates repeated rules from page-level stylesheets.
   ===================================================================== */

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: var(--space-xs);
}

.form-control,
.form-select,
.form-control-custom,
.form-select-custom {
    border-radius: 10px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: var(--transition);
    background-color: #ffffff;
}

.form-control:focus,
.form-select:focus,
.form-control-custom:focus,
.form-select-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(212, 165, 116, 0.25);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border: 1px solid var(--danger-color);
    box-shadow: 0 0 0 0.1rem rgba(231, 76, 60, 0.15);
}

.form-control.is-valid,
.form-select.is-valid {
    border: 1px solid var(--success-color);
    box-shadow: 0 0 0 0.1rem rgba(39, 174, 96, 0.15);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border: 1px solid var(--danger-color);
    box-shadow: 0 0 0 0.1rem rgba(231, 76, 60, 0.15);
}

.form-control.is-valid:focus,
.form-select.is-valid:focus {
    border: 1px solid var(--success-color);
    box-shadow: 0 0 0 0.1rem rgba(39, 174, 96, 0.15);
}

.form-control.is-invalid,
.form-control.is-valid,
.form-select.is-invalid,
.form-select.is-valid {
    background-image: none !important;
    padding-right: 0.75rem !important;
}

.form-select.is-valid {
    padding-right: 2.25rem !important;
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: var(--space-xs);
    font-size: 0.875rem;
    color: var(--danger-color);
}

.invalid-feedback.show {
    display: block;
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: var(--space-xs);
    font-size: 0.875rem;
    color: var(--success-color);
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: none;
}

.success-message.show {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

.alert-fixed-center {
    position: fixed !important;
    top: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9999 !important;
    width: fit-content !important;
    max-width: min(90vw, 600px) !important;
    min-width: min(320px, 90vw) !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
    padding: 0.75rem 1.75rem !important;
    flex-wrap: nowrap !important;
    white-space: normal !important;
    opacity: 1 !important;
    transition: opacity 0.5s ease-in !important;
}

.alert-fixed-center.fade {
    opacity: 0 !important;
    transition: opacity 0.5s ease-out !important;
}

.alert-fixed-center.alert-danger,
.contact-form .alert-danger {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem 1rem !important;
}

.alert-fixed-center.alert-success,
.contact-form .alert-success {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
    color: #0f5132 !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem 1rem !important;
}

.alert-fixed-center .btn-close,
.contact-form .btn-close {
    margin-left: auto !important;
    flex-shrink: 0 !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    padding: 0 !important;
}

.alert-fixed-center .notification-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    max-width: 90%;
    width: fit-content;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-notification.position-fixed {
    right: 20px;
    max-width: 380px;
}

@media (max-width: 768px) {
    .cart-notification.position-fixed {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        width: calc(100% - 40px) !important;
        max-width: 360px !important;
        text-align: center;
    }
}

.rating-stars {
    display: flex;
    gap: 0.5rem;
    font-size: 1.5rem;
    color: #dddddd;
    margin-bottom: 0.5rem;
}

.rating-stars .star-rating {
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.rating-stars .star-rating:focus-visible {
    outline: 2px solid var(--primary-color);
    border-radius: 50%;
}

.rating-stars .star-rating:hover,
.rating-stars .star-rating.active,
.rating-stars .star-rating.filled,
.rating-stars .star-rating.bi-star-fill {
    color: var(--warning-color) !important;
    transform: scale(1.1);
}

.rating-stars .star-rating.bi-star {
    color: #dddddd;
}

.reservation-form,
.review-form,
.login-form-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 2rem !important;
    max-width: 700px;
    margin: 0 auto;
    box-sizing: border-box;
}

.contact-form-card {
    background: #fefcf8;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2rem !important;
    border: none;
    position: relative;
    overflow: hidden;
    max-width: 700px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Responsive adjustments for contact form card */
@media (max-width: 992px) {
    .contact-form-card {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .contact-form-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .reservation-form {
        margin-top: 1.5rem;
    }

    .reservation-form .btn {
        font-size: 1.2rem;
        padding: 0.65rem 1rem;
    }
}

.reservation-form .btn,
.contact-form-card .btn,
.review-form .btn {
    font-weight: 600;
    
}

.reservation-form .form-control.is-invalid,
.reservation-form .form-select.is-invalid {
    border: 1px solid var(--danger-color);
    box-shadow: 0 0 0 0.1rem rgba(231, 76, 60, 0.15);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='M6 3v4M6 9h.01'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.reservation-form .form-control.is-invalid:focus,
.reservation-form .form-select.is-invalid:focus {
    border: 1px solid var(--danger-color);
    box-shadow: 0 0 0 0.1rem rgba(231, 76, 60, 0.15);
}

.reservation-form .form-control.is-valid,
.reservation-form .form-select.is-valid {
    border: 1px solid var(--success-color);
    box-shadow: 0 0 0 0.1rem rgba(39, 174, 96, 0.15);
}

.reservation-form .form-control.is-valid:focus,
.reservation-form .form-select.is-valid:focus {
    border: 1px solid var(--success-color);
    box-shadow: 0 0 0 0.1rem rgba(39, 174, 96, 0.15);
}

#addReviewModal .form-control.is-invalid,
#addReviewModal .form-select.is-invalid,
#dishReviewModal .form-control.is-invalid,
#dishReviewModal .form-select.is-invalid {
    border-color: var(--danger-color);
    border-width: 1px;
    box-shadow: 0 0 0 0.1rem rgba(231, 76, 60, 0.15);
}

#addReviewModal .form-control.is-valid,
#addReviewModal .form-select.is-valid,
#dishReviewModal .form-control.is-valid,
#dishReviewModal .form-select.is-valid {
    border-color: var(--success-color);
    border-width: 1px;
    box-shadow: 0 0 0 0.1rem rgba(39, 174, 96, 0.15);
}

#addReviewModal .modal-body .contact-form .form-control,
#addReviewModal .modal-body .contact-form .form-select {
    border: 2px solid #ced4da;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    background-color: #fefcf8;
}

#addReviewModal .modal-body .contact-form .form-control:focus,
#addReviewModal .modal-body .contact-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(212, 165, 116, 0.25);
    background-color: #fefcf8;
}

#addReviewModal .modal-footer .btn,
#dishReviewModal .modal-footer .btn {
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

