/* Archivo de estilos para Calculadora de Costeo de Menú extraído de index.html */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --tertiary-color: #9b59b6;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-gray: #ecf0f1;
    --medium-gray: #bdc3c7;
    --dark-gray: #7f8c8d;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --font-family: 'Poppins', sans-serif;
    --border-radius: 8px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--primary-color);
    margin: 0;
    padding: 20px 10px;
}

#app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px;
}

header { text-align: center; margin-bottom: 40px; position: relative; }
header h1 { font-size: 2.2em; margin-bottom: 5px; }
header h1 i { color: var(--secondary-color); }
header p { color: var(--dark-gray); font-size: 1.1em; }

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px 30px;
    margin-bottom: 30px;
}

h2 {
    margin-top: 0;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    justify-content: start;
}
h2 i { margin-right: 10px; color: var(--secondary-color); }

.form-grid { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 15px; align-items: flex-end; }
.form-grid-small { display: grid; grid-template-columns: 3fr 1fr auto; gap: 15px; align-items: flex-end; }
.form-group { display: flex; flex-direction: column; }
label { margin-bottom: 8px; font-weight: 600; font-size: 0.9em; }

input, select, button {
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 6px;
    font-size: 1em;
    font-family: var(--font-family);
    box-sizing: border-box;
    height: 42px;
}

button { border: none; cursor: pointer; color: white; transition: all 0.2s ease; font-weight: 600; }
input:focus, select:focus { outline: none; border-color: var(--secondary-color); box-shadow: 0 0 5px rgba(52, 152, 219, 0.3); }
button:active { transform: translateY(1px); }

.btn-add { background-color: var(--success-color); }
.btn-add:hover { background-color: #2ecc71; }
.btn-save { background-color: var(--secondary-color); width: 100%; margin-top: 10px; }
.btn-save:hover { background-color: #5dade2; }
.btn-reset { background-color: #95a5a6; width: 100%; margin-top: 20px; }
.btn-reset:hover { background-color: var(--dark-gray); }
.btn-export { background-color: var(--tertiary-color); }
.btn-export:hover { background-color: #af7ac5; }
.btn-import { background-color: var(--dark-gray); }
.btn-import:hover { background-color: var(--primary-color); }
.btn-manager { background-color: var(--warning-color); position: absolute; top: 0; right: 0; }
.btn-manager:hover { background-color: #f5b041; }

.error-message { color: var(--danger-color); margin-top: 10px; height: 1em; font-weight: 600; font-size: 0.9em; visibility: hidden; }
.error-message.visible { visibility: visible; }

#platillo-table { width: 100%; border-collapse: collapse; }
#platillo-table th, #platillo-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--light-gray); }
#platillo-table th { font-weight: 700; }
#platillo-table tr:last-child td { border-bottom: none; }
#platillo-table td:nth-child(3) { font-weight: 600; text-align: right; }
#platillo-table td:nth-child(4) { text-align: center; }

.delete-btn { background: none; color: var(--dark-gray); font-size: 1.1em; padding: 5px; height: auto; }
.delete-btn:hover { color: var(--danger-color); }

#empty-state { text-align: center; padding: 40px 20px; color: var(--dark-gray); display: none; }
#empty-state i { font-size: 3em; margin-bottom: 15px; color: var(--medium-gray); }
#empty-state.active { display: block; }

#save-form { margin-top: 20px; margin-bottom: 20px; }
#nombre-platillo-input { width: 100%; }

/* Estilos para Platillos Guardados */
.io-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
#lista-guardados { list-style: none; padding: 0; margin: 0; max-height: 40vh; overflow-y: auto;}
.saved-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border-bottom: 1px solid var(--light-gray); gap: 10px; }
.saved-item:last-child { border-bottom: none; }
.saved-item-info { flex-grow: 1; }
.saved-item-info span { font-weight: 600; }
.saved-item-info small { color: var(--dark-gray); display: block; }
.saved-item-actions button { background: none; height: auto; padding: 5px 8px; font-size: 1.2em; }
.btn-add-saved { color: var(--secondary-color); }
.btn-load { color: var(--success-color); }
.btn-delete-saved { color: var(--danger-color); }

/* Estilos para el Análisis de Precio */
.pricing-list { list-style: none; padding: 0; margin: 0; }
.pricing-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--light-gray); }
.pricing-item:last-child { border-bottom: none; }
.pricing-item .label { font-weight: 600; }
.pricing-item .value { font-size: 1.2em; font-weight: 700; }
#info-utilidad-redondeado { color: var(--success-color); font-weight: 700; }
#info-precio-didi-redondeado { color: var(--warning-color); font-weight: 700; }

/* Estilos del Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 100; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal-container { background: var(--bg-color); padding: 30px; border-radius: var(--border-radius); width: 90%; max-width: 1100px; max-height: 90vh; overflow-y: auto; transform: scale(0.9); transition: transform 0.3s; display: flex; flex-direction: column; }
.modal-overlay.visible .modal-container { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--medium-gray); padding-bottom: 15px; margin-bottom: 20px; }
.modal-close-btn { font-size: 2em; font-weight: bold; cursor: pointer; color: var(--dark-gray); background: none; border: none; height: auto; }
.modal-content { flex-grow: 1; }
.manager-table { width: 100%; border-collapse: collapse; }
.manager-table th, .manager-table td { padding: 10px; border: 1px solid var(--light-gray); text-align: left; vertical-align: middle;}
.manager-table td input, .manager-table td select { height: 38px; width: 100%; box-sizing: border-box;}
.manager-table td:last-child { width: 120px; text-align: center; }
.manager-table .info-cost { color: var(--dark-gray); font-style: italic; font-size: 0.9em; }
.modal-footer { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--medium-gray); }

/* Layout de Columnas para Pantallas Grandes */
@media (min-width: 992px) {
    main { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: flex-start; }
    .btn-manager { font-size: 0.8em; padding: 8px 12px; height: auto; }
}
@media (max-width: 991px) {
    .form-grid, .form-grid-small { grid-template-columns: 1fr; }
    button { height: auto; padding: 12px; }
    .btn-manager { display: none; }
}
