/* language: css */
@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

/* ======= Reset general ======= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f5f7;          /* mismo tono que listado */
    color: #343a40;
    line-height: 1.6;
}

/* ======= Layout containers ======= */
.container,
.page-container {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    padding: 1rem !important;
}

/* formularios / detalle */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem 2.25rem;
}

/* listados / paneles amplios */
.page-container {
    max-width: 1100px;
    margin: 2rem auto;
    padding: 2rem 2.5rem 2.5rem;
}

/* Auth pages (login/registro) wrapper to center the card */
.auth-page {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

/* ======= Headings ======= */
h1,
h2,
h3 {
    color: #212529;
    font-weight: 600;
}

/* título centrado genérico (crear receta, etc.) */
h1 {
    text-align: center;
    margin-bottom: 2rem;
}

/* cabecera de página tipo listado */
.page-header {
    margin-bottom: 1.75rem;
    text-align: left;
}

.page-title {
    font-size: 1.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #111827;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    margin-left: 1rem;
}

/* ======= Forms ======= */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    font-weight: 600;
    font-size: 0.98rem;
    color: #374151;
}

/* General inputs para toda la app */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    background-color: #f9fafb;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6366f1; /* tono violeta de la nav */
    outline: 0;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
    background-color: #ffffff;
}

textarea {
    resize: vertical;
    min-height: 90px;
}

/* checkboxes simples */
input[type="checkbox"] {
    width: auto;
    margin-right: 0.4rem;
}

/* ======= Buttons ======= */
button,
.action-btn,
a.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.3rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* Primary submit button (verde, global) */
button[type="submit"] {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    align-self: center;
    min-width: 180px;
    margin-top: 0.75rem;
    box-shadow: 0 8px 18px rgba(22, 163, 74, 0.35);
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(22, 163, 74, 0.42);
}

button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(22, 163, 74, 0.3);
}

/* Secondary / normal action buttons (azul) */
button[type="button"] {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

button[type="button"]:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

/* Botón rojo circular de eliminar fila */
.remove {
    background: #ef4444;
    color: white;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    font-weight: 700;
    padding: 0;
    line-height: 30px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 8px;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.35);
}

.remove:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* ======= Dynamic rows (crear recetas) ======= */
.ingrediente-row,
.paso-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px 12px;
    border-radius: 8px;
    background-color: #f3f4f6;
    border: 1px dashed #e5e7eb;
}

#ingredientes-wrapper,
#pasos-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.paso-row .paso-numero {
    font-weight: 600;
    font-size: 1.05rem;
    color: #4f46e5;
    padding-top: 0.6rem;
    min-width: 26px;
}

.paso-row textarea {
    flex-grow: 1;
}

/* ======= Alerts (used in varias páginas) ======= */
.error {
    color: #b91c1c;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.success {
    padding: 0.9rem 1rem;
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    text-align: left;
    margin-bottom: 1rem;
}

.alert {
    padding: 0.9rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-danger {
    color: #b91c1c;
    background-color: #fee2e2;
    border-color: #fecaca;
}

.alert-success {
    color: #166534;
    background-color: #dcfce7;
    border-color: #bbf7d0;
}

/* ======= Tables, badges, actions (listados) ======= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.75rem;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.95rem;
}

thead tr {
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #ffffff;
    text-align: left;
    font-weight: 600;
}

th,
td {
    padding: 12px 16px;
    vertical-align: top;
}

tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

tbody tr:hover {
    background-color: #eef2ff;
}

td ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style-type: disc;
}

/* badges de dificultad */
.badge {
    display: inline-block;
    padding: 0.35em 0.7em;
    font-size: 0.78em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.badge-facil{
    background-color: #22c55e;
}

.badge-normal {
    background-color: #eab308;
    color: #111827;
}

.badge-dificil {
    background-color: #ef4444;
}

/* acciones tabla / ingredientes */
.actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* botones de acción en tablas */
.action-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

/* editar */
.action-btn.edit {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
}

.action-btn.edit:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
}

/* eliminar */
.action-btn.delete {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
}

.action-btn.delete:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

/* mensajes de lista vacía */
.no-data {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 1.02rem;
    color: #6b7280;
}

/* formularios inline (ingredientes) */
.inline-edit-form {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/*.inline-edit-form input {
  flex-grow: 1;  
}*/
.badge.badge-publica {
    background-color: #22c55e;
}

.badge-privada {
    background-color: #dc2626;
}
/* ======= Responsive ======= */
@media (max-width: 600px) {
    .container,
    .page-container {
        margin: 1rem;
        padding: 1.5rem 1.25rem;
    }

    button[type="submit"] {
        width: 100%;
    }

    thead {
        font-size: 0.88rem;
    }
}
