﻿/* Main container - using existing crud container */
.condition-container {
    max-width: 1200px;
    width: 100%;
    margin: 80px auto;
    padding: 0 20px 40px;
}

.condition-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    
}


.condition-card {
    flex: 0 1 calc(33.33% - 14px); /* Allows 3 cards per row */
    min-width: 300px;
    height: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

    .condition-card:hover {
        box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
    }
.restaurant-header {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.condition-restaurant-name {
    font-family: Calibri;
    font-size: 0.85em;
    color: #777;
    margin-top: 10px;
}

.restaurant-category {
    font-size: 1.1em;
    color: #666;
}

.condition-status {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-size: 0.85em;
    color: #666;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
}

    .status-badge.yes {
        background-color: #e8f5e9;
        color: #2e7d32;
    }

    .status-badge.no {
        background-color: #ffebee;
        color: #c62828;
    }

/* Table Layout */
.condition-items {
    width: 100%;
    border-collapse: collapse;
}

    .condition-items td {
        padding: 12px 15px;
        border-bottom: 1px solid #eee;
    }

    .condition-items tr:last-child td {
        border-bottom: none;
    }

.item-name {
    color: #333;
    width: 70%;
}

.item-price {
    color: #666;
    text-align: right;
    width: 15%;
}

.item-action {
    text-align: right;
    width: 15%;
}

/* Action Buttons */
.condition-actions {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: right;
}





/* Filter Styles */
.condition-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}

.filter-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
}

    .filter-group label {
        color: #666;
        font-size: 0.9em;
        white-space: nowrap;
        
    }

.filter-select {
    flex: 1;
    min-width: 280px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    color: #333;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 1em;
}

    .filter-select:focus {
        border-color: #4a90e2;
        outline: none;
    }

@media (max-width: 992px) {
    .condition-card {
        flex: 0 1 calc(50% - 14px); /* 2 cards per row */
    }
}
/* Responsive */
@media (max-width: 768px) {

    .condition-card {
        flex: 0 1 100%; /* 1 card per row */
    }
    .crud-container {
        padding: 0 15px;
        margin: 20px auto;
    }

    .condition-status {
        flex-direction: column;
        gap: 8px;
    }

    .status-item {
        justify-content: space-between;
    }

    .filter-form {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group {
        width: 100%;
    }

    .filter-select {
        width: 100%;
       
    }
}

@media (max-width: 480px) {
    .condition-items td {
        padding: 10px;
    }

    .item-price {
        width: 20%;
    }

    .item-action {
        width: 20%;
    }

    .crud-action-btn {
        padding: 4px 8px;
        font-size: 0.85em;
    }
}





/* Edit page */
/* Reusing crud-container and base styles */
.condition-edit {
    max-width: 800px;
    margin: 80px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.condition-edit-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.condition-edit-title {
    font-size: 1.4em;
    color: #333;
    margin: 0;
}

/* Form Groups - keeping original class for JS */
.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        color: #666;
        font-size: 0.9em;
    }

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    color: #333;
}

    .form-control[readonly] {
        background-color: #f8f9fa;
        cursor: not-allowed;
    }

/* Checkbox styling - keeping original classes for JS */
.form-check {
    margin: 15px 0;
}

.form-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check-input {
    margin: 0;
}

/* Condition Items Container - keeping ID for JS */
#conditionsContainer {
    margin: 20px 0;
}

/* Individual condition inputs - keeping class for JS */
.condition-inputs {
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 4px;
}

/* Button Styles */
.button-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Keep btn class for Bootstrap compatibility */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: none;
}

    .btn.primary {
        background: #4a90e2;
        color: #fff;
    }

        .btn.primary:hover {
            background: #357abd;
        }

    .btn.secondary {
        background: #6c757d;
        color: #fff;
        margin: 10px 0;
    }

        .btn.secondary:hover {
            background: #5a6268;
        }

.button.back {
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
}

    .button.back:hover {
        background: #f8f9fa;
    }

/* Validation Messages - keeping classes for validation */
.text-danger {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 4px;
}

.alert {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-danger {
    background: #fff5f5;
    color: #dc3545;
    border: 1px solid #f5c6cb;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .condition-edit {
        margin: 15px;
        padding: 15px;
    }

    .button-container {
        flex-direction: column;
    }

    .btn, .button.back {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .condition-edit {
        margin: 10px;
        padding: 10px;
    }

    .condition-inputs {
        padding: 10px;
    }
}
/* End of Edit page */

/* Create Page */
/* Shared Form Layout for Create and Edit */
.condition-form {
    max-width: 800px;
    margin: 120px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.condition-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.condition-title {
    font-size: 1.4em;
    color: #333;
    margin: 0;
}

/* Form Elements - keeping original classes for JS */
.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        color: #666;
        font-size: 0.9em;
    }

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95em;
    color: #333;
    transition: border-color 0.2s;
}

    .form-control:focus {
        border-color: #4a90e2;
        outline: none;
    }

/* Select Styling */
select.form-control {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 1em;
    padding-right: 30px;
    appearance: none;
}

/* Checkbox Styling */
.form-check {
    margin: 15px 0;
}

.form-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #333;
}

.form-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
}

/* Condition Items Section */
#conditionsContainer {
    margin: 20px 0;
}

.condition-inputs {
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 4px;
}

    .condition-inputs:last-child {
        margin-bottom: 0;
    }

/* Action Buttons */
#addCondition {
    width: 100%;
    margin: 10px 0 20px;
    padding: 8px 16px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    #addCondition:hover {
        background: #5a6268;
    }

.button-container {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    text-decoration: none;
}

    .btn.primary {
        background: #4a90e2;
        color: #fff;
    }

        .btn.primary:hover {
            background: #357abd;
        }

.button.back {
    padding: 8px 16px;
    color: #eee;
    background: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
}

    .button.back:hover {
        background: #f8f9fa;
    }

/* Validation Styles */
.text-danger {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 4px;
    display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
    .condition-form {
        margin: 15px;
        padding: 15px;
    }

    .button-container {
        flex-direction: column;
    }

    .btn, .button.back {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .condition-form {
        margin: 10px;
        padding: 10px;
    }

    .condition-inputs {
        padding: 10px;
    }
}
/* End of Create page*/


