/* Ethical Menus Frontend Styles - Premium Green, White & Black Theme
   ========================================================================== */

.ethical-menus-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #2c3e50;
    line-height: 1.6;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    color: #2c3e50;
    font-weight: 600;
    margin-top: 0;
}

/* ===== CONTROLS SECTION ===== */
.em-controls {
    margin-bottom: 40px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    border: 1px solid #ecf0f1;
}

/* ===== BUTTON STYLES ===== */
.em-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.em-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.em-btn:hover::after {
    width: 300px;
    height: 300px;
}

.em-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 204, 113, 0.25);
}

.em-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.2);
}

.em-btn-primary {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
}

.em-btn-primary:hover {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.em-btn-success {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.em-btn-success:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
}

.em-btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.em-btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
}

.em-btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.em-btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

.em-btn-secondary {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
}

.em-btn-secondary:hover {
    background: linear-gradient(135deg, #2c3e50, #1e2b38);
}

.em-btn-small {
    padding: 8px 20px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

.em-edit-toggle {
    background: linear-gradient(135deg, #2c3e50, #1e2b38);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

.em-edit-toggle.active {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.em-edit-toggle.active:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}

/* ===== CATEGORY CARD STYLES ===== */
.em-menu-category {
    margin-bottom: 30px;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    border: 1px solid #ecf0f1;
}

.em-menu-category:hover {
    box-shadow: 0 15px 30px rgba(46, 204, 113, 0.08);
    border-color: #2ecc71;
    transform: translateY(-2px);
}

/* ===== CATEGORY HEADER STYLES ===== */
.em-category-header,
.em-subcategory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background: white;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.em-category-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.em-category-header:hover::before {
    opacity: 1;
}

.em-category-header:hover,
.em-subcategory-header:hover {
    background: #fafffd;
}

/* ===== CATEGORY NAME STYLES ===== */
.em-category-name {
    font-weight: 700;
    font-size: 20px;
    color: #2c3e50;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.em-category-name::before {
    content: '●';
    color: #2ecc71;
    font-size: 24px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.em-subcategory-name {
    font-weight: 600;
    font-size: 17px;
    color: #34495e;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.em-subcategory-name::before {
    content: '○';
    color: #27ae60;
    font-size: 20px;
}

/* ===== CATEGORY TOGGLE ICON ===== */
.em-category-toggle {
    font-size: 22px;
    color: #95a5a6;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.em-category-header:hover .em-category-toggle,
.em-subcategory-header:hover .em-category-toggle {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
    transform: scale(1.1);
}

/* ===== CATEGORY CONTENT ===== */
.em-category-content {
    padding: 30px;
    background: white;
    display: none;
    animation: fadeIn 0.4s ease;
}

.em-category-content:not(.collapsed) {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== SUBCATEGORY STYLES ===== */
.em-subcategories-wrapper {
    margin-top: 30px;
}

.em-subcategory-container {
    margin-left: 30px;
    margin-top: 20px;
    border-left: 4px solid #2ecc71;
    border-radius: 0 12px 12px 0;
    background: #fafffd;
    transition: all 0.3s ease;
    border-top: 1px solid #ecf0f1;
    border-right: 1px solid #ecf0f1;
    border-bottom: 1px solid #ecf0f1;
}

.em-subcategory-container:hover {
    border-left-color: #27ae60;
    background: white;
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.08);
}

.em-subcategory-header {
    background: #fafffd;
    padding: 15px 25px;
}

.em-subcategory-content {
    padding: 25px;
    background: white;
    display: none;
    animation: fadeIn 0.4s ease;
}

.em-subcategory-content:not(.collapsed) {
    display: block;
}

/* ===== CATEGORY & SUBCATEGORY ACTION BUTTONS ===== */
.em-category-actions,
.em-subcategory-actions {
    display: flex;
    gap: 10px;
    margin-right: 15px;
}

.em-category-actions .em-btn,
.em-subcategory-actions .em-btn {
    padding: 6px 16px;
    font-size: 12px;
    box-shadow: none;
    border-radius: 30px;
    text-transform: none;
    letter-spacing: normal;
}

/* ===== TABLE STYLES - CLEAN & PROFESSIONAL ===== */
.em-items-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 20px;
    border: 1px solid #ecf0f1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.02);
    background: white;
}

.em-items-table thead {
    background: linear-gradient(135deg, #2c3e50, #34495e);
}

.em-items-table th {
    color: white;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.em-items-table th:last-child {
    border-right: none;
}

.em-items-table tbody tr {
    background: white;
    transition: all 0.2s ease;
}

/* Light yellow hover effect - view mode */
.em-items-table tbody tr:hover {
    background: #fff9e6 !important;
    cursor: default;
}

/* Zebra striping */
.em-items-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.em-items-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #ecf0f1;
    border-right: 1px solid #ecf0f1;
    color: #2c3e50;
    font-size: 15px;
}

.em-items-table td:last-child {
    border-right: none;
}

.em-items-table tbody tr:last-child td {
    border-bottom: none;
}

/* Price styling - Green */
.em-items-table td:nth-child(3),
.em-items-table td:nth-child(4) {
    font-weight: 700;
    color: #27ae60;
    font-size: 16px;
}

/* Item name styling */
.em-items-table td:first-child {
    font-weight: 600;
    color: #2c3e50;
}

/* ===== EDIT MODE STYLES - ONLY IN EDIT MODE ===== */
.em-edit-mode .em-item-field-cell {
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.em-edit-mode .em-item-field-cell:hover {
    background: #fff9e6 !important;
}

.em-edit-mode .em-item-field-cell:hover::after {
    content: '✎';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #2ecc71;
    font-size: 16px;
    font-weight: bold;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

/* Subcategory items in edit mode */
.em-edit-mode .em-subcategory-content .em-item-field-cell {
    cursor: pointer;
}

.em-edit-mode .em-subcategory-content .em-item-field-cell:hover {
    background: #fff9e6 !important;
}

.em-edit-mode .em-subcategory-content .em-item-field-cell:hover::after {
    content: '✎';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #2ecc71;
    font-size: 16px;
    font-weight: bold;
}

/* Inline edit input */
.em-item-edit-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #2ecc71;
    border-radius: 8px;
    font-size: 15px;
    background: white;
    color: #2c3e50;
    font-weight: 400;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

.em-item-edit-input:focus {
    outline: none;
    border-color: #27ae60;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.15);
}

/* ===== ADD ITEM FORM - ELEGANT DESIGN ===== */
.em-add-item-form {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #fafffd, white);
    border-radius: 16px;
    border: 1px solid #2ecc71;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.06);
    position: relative;
    overflow: hidden;
}

.em-add-item-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #2ecc71, #27ae60, #2ecc71);
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.em-add-item-form h4 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.em-add-item-form h4::before {
    content: '●';
    color: #2ecc71;
    font-size: 24px;
}

.em-form-row {
    display: grid;
    grid-template-columns: 1.2fr 1.2fr 0.6fr 0.6fr auto;
    gap: 15px;
    align-items: center;
}

/* ===== CSV UPLOAD FORM - MODERN STYLING ===== */
.em-csv-upload-form {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #f0fff4, white);
    border-radius: 16px;
    border: 1px dashed #2ecc71;
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.04);
}

.em-csv-upload-form h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #27ae60;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.em-csv-upload-form h4::before {
    content: '📁';
    font-size: 22px;
}

.em-csv-info {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f0fff4, #e8f8f5);
    border-radius: 12px;
    border-left: 4px solid #2ecc71;
}

.em-csv-info p {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 15px;
}

.em-csv-template-link {
    color: #27ae60;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(46, 204, 113, 0.1);
    border-radius: 30px;
}

.em-csv-template-link:hover {
    color: #2ecc71;
    background: rgba(46, 204, 113, 0.15);
    transform: translateY(-1px);
}

.em-csv-upload-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.em-csv-file-input {
    display: none;
}

.em-csv-file-name {
    font-size: 14px;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid #ecf0f1;
}

/* ===== PROGRESS BAR ===== */
.em-csv-progress {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    position: relative;
    border: 1px solid #ecf0f1;
}

.em-csv-progress-bar {
    height: 28px;
    background: linear-gradient(90deg, #2ecc71, #27ae60, #2ecc71);
    background-size: 200% 100%;
    border-radius: 14px;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}

.em-csv-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    letter-spacing: 0.5px;
}

/* ===== RESULTS MESSAGES ===== */
.em-csv-results {
    margin-top: 25px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.em-csv-success {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0fff4, #e8f8f5);
    color: #27ae60;
    border-left: 4px solid #2ecc71;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.em-csv-success::before {
    content: '✓';
    font-size: 20px;
    font-weight: bold;
}

.em-csv-error {
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff5f5, #fee);
    color: #e74c3c;
    border-left: 4px solid #e74c3c;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 15px;
}

.em-csv-error ul {
    margin: 12px 0 0 25px;
    padding: 0;
}

.em-csv-error li {
    margin: 6px 0;
    color: #c0392b;
}

/* ===== FORM CONTROLS ===== */
.em-form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
}

.em-form-control:focus {
    border-color: #2ecc71;
    outline: none;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
    background: white;
}

.em-form-control::placeholder {
    color: #bdc3c7;
    font-style: italic;
}

/* ===== ITEM COUNT BADGE ===== */
.em-item-count {
    font-size: 13px;
    color: white;
    font-weight: 600;
    margin-left: 12px;
    background: #2ecc71;
    padding: 4px 12px;
    border-radius: 50px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(46, 204, 113, 0.2);
}

/* ===== LOADING STATES ===== */
.em-loading {
    text-align: center;
    padding: 80px 40px;
    color: #7f8c8d;
    background: white;
    border-radius: 20px;
    border: 1px solid #ecf0f1;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.em-loading .spinner {
    float: none;
    margin: 0;
    width: 50px;
    height: 50px;
    border: 3px solid #ecf0f1;
    border-top-color: #2ecc71;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== EMPTY STATES ===== */
.em-no-data {
    text-align: center;
    padding: 80px 40px;
    color: #95a5a6;
    font-style: italic;
    background: white;
    border-radius: 20px;
    border: 2px dashed #ecf0f1;
    font-size: 16px;
}

.em-error {
    text-align: center;
    padding: 80px 40px;
    color: #e74c3c;
    background: #fff5f5;
    border-radius: 20px;
    border: 2px dashed #e74c3c;
    font-size: 16px;
}

/* ===== MODAL STYLES ===== */
.em-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.3s ease;
}

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

.em-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(44, 62, 80, 0.9);
    backdrop-filter: blur(5px);
}

.em-modal-content {
    position: relative;
    background: white;
    width: 480px;
    max-width: 92%;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    z-index: 100001;
    padding: 35px;
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.em-modal-content h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    padding-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
    .em-form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .em-form-row .em-btn {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .ethical-menus-container {
        padding: 20px 15px;
    }
    
    .em-controls {
        flex-direction: column;
        padding: 15px;
    }
    
    .em-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    .em-form-row {
        grid-template-columns: 1fr;
    }
    
    .em-form-row .em-btn {
        grid-column: span 1;
    }
    
    .em-csv-upload-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .em-csv-upload-row button {
        width: 100%;
    }
    
    .em-csv-file-name {
        text-align: center;
    }
    
    .em-items-table {
        font-size: 14px;
        border-radius: 10px;
    }
    
    .em-items-table th,
    .em-items-table td {
        padding: 12px 10px;
    }
    
    .em-category-header,
    .em-subcategory-header {
        padding: 15px 20px;
    }
    
    .em-category-name {
        font-size: 18px;
    }
    
    .em-subcategory-name {
        font-size: 16px;
    }
    
    .em-category-content,
    .em-subcategory-content {
        padding: 20px;
    }
    
    .em-subcategory-container {
        margin-left: 15px;
    }
    
    .em-edit-mode .em-item-field-cell:hover::after,
    .em-edit-mode .em-subcategory-content .em-item-field-cell:hover::after {
        display: none;
    }
    
    .em-modal-content {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .em-category-actions,
    .em-subcategory-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .em-category-name,
    .em-subcategory-name {
        font-size: 16px;
    }
    
    .em-items-table th {
        font-size: 12px;
        padding: 10px 8px;
    }
    
    .em-items-table td {
        font-size: 13px;
        padding: 10px 8px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .em-controls,
    .em-category-actions,
    .em-subcategory-actions,
    .em-add-item-form,
    .em-csv-upload-form,
    .em-modal,
    .em-btn {
        display: none !important;
    }
    
    .ethical-menus-container {
        padding: 0;
        max-width: 100%;
    }
    
    .em-menu-category {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }
    
    .em-category-content,
    .em-subcategory-content {
        display: block !important;
    }
    
    .em-items-table {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .em-items-table th {
        background: #f5f5f5;
        color: black;
        border-bottom: 2px solid #ddd;
    }
    
    .em-category-toggle {
        display: none;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-green { color: #2ecc71; }
.text-dark { color: #2c3e50; }
.bg-white { background: white; }
.bg-light-green { background: #fafffd; }
.rounded-full { border-radius: 9999px; }
.shadow-lg { box-shadow: 0 10px 30px rgba(0,0,0,0.1); }