/*
 * Krishna Catering CSS
 *
 * This stylesheet handles the front-end layout and styling
 * for the catering order form.
 */

/* ==========================================================================
   General Form and Layout
   ========================================================================== */

#krishna-catering-form-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

h2 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f97a59;
    padding-bottom: 0.5rem;
}

.form-section {
    margin-bottom: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-grid label {
    display: block;
    margin-bottom: 0;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: #f97a59;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

/* ==========================================================================
   Menu Items Section
   ========================================================================== */

.loading-message {
    text-align: center;
    color: #888;
    font-style: italic;
}

.menu-section {
    margin-bottom: 2rem;
}

/* Section Title - bigger font on both large and small screens */
.menu-section h3 {
    font-size: 2rem; 
    font-weight: bold;
    color: #f97a59;
    padding: 0;
    margin-bottom: 1rem;
}

/* Menu items grid */
.menu-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.menu-item {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-item h4 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #f97a59;
}

/* Make body font not bold */
.menu-item .description,
.menu-item .detail-row .value {
    font-weight: normal;
}

.menu-item .description {
    font-size: 0.9rem;
    color: #666;
}

/* Layout for Unit Price and Min Order - narrower on large screens */
.menu-item .item-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 0.9rem;
    color: #444;
    margin-top: 10px;
    padding: 0 5px;
}

.menu-item .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-item .item-details .label {
    font-weight: 500;
}

/* Badges - line up under or above same kind of badge */
.menu-item .badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 15px;
    min-height: 20px;
}

.menu-item .badge {
    font-size: 0.8rem;
    color: #fff;
    background: #888;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

/* Quantity Controls - center aligned */
.quantity-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
    text-align: center;
}

.quantity-control label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #444;
}

.quantity-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quantity-control button {
    background: #f97a59;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-control button:hover {
    background: #e66b4f;
}

.quantity-control button:active {
    transform: scale(0.95);
}

.quantity-control input {
    width: 60px;
    text-align: center; /* Center align text inside the quantity field */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

/* ==========================================================================
   Order Summary and Actions
   ========================================================================== */

#order-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

#order-summary-table th,
#order-summary-table td {
    border: 1px solid #eee;
    padding: 12px;
    text-align: left;
}

#order-summary-table th {
    background: #f4f4f4;
    font-weight: bold;
}

.total-price-container {
    text-align: right;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 1rem;
    color: #333;
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.submit-button {
    background: #f97a59;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.submit-button:hover:not(:disabled) {
    background: #e66b4f;
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ==========================================================================
   Utility and Modal
   ========================================================================== */

.required {
    color: #f97a59;
    margin-left: 4px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: none;
    border-radius: 12px;
    width: 80%;
    max-width: 500px;
    text-align: center;
    position: relative;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

#modal-title {
    color: #f97a59;
}
