/* Importar una fuente moderna de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* --- Variables y Reset Básico --- */
:root {
    --primary-color: #007bff; /* Azul vibrante */
    --secondary-color: #6c757d; /* Gris para botones secundarios */
    --background-light: #f8f9fa;
    --background-dark: #ffffff;
    --text-color: #343a40;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --border-radius: 8px;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-light);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px 0;
}

/* --- Contenedor Principal --- */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

/* --- Header y Títulos --- */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
}

.icon-header {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.header h1 {
    font-weight: 700;
    font-size: 1.8rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.section-title i {
    margin-right: 10px;
}

/* --- Formulario de Ingreso/Edición --- */
.form-section, .list-section {
    background-color: var(--background-dark);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    resize: vertical;
    min-height: 100px;
    font-family: 'Poppins', sans-serif;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* --- Botones --- */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.3s, transform 0.1s;
    margin-right: 10px;
}

.btn i {
    margin-right: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Botones de Ícono (Editar/Eliminar) */
.btn-icon {
    padding: 8px;
    margin: 0 5px;
    font-size: 1rem;
    width: 40px; /* Tamaño fijo para el círculo */
    height: 40px;
    justify-content: center;
    border-radius: 50%; /* Circular */
}

.btn-icon i {
    margin: 0;
}

.edit-btn {
    background-color: var(--warning-color);
    color: var(--text-color);
}

.edit-btn:hover {
    background-color: #e0a800;
    transform: scale(1.05);
}

.delete-btn {
    background-color: var(--error-color);
    color: white;
}

.delete-btn:hover {
    background-color: #bd2130;
    transform: scale(1.05);
}

/* --- Lista de Avisos --- */
.aviso-list {
    list-style: none;
    padding: 0;
}

.aviso-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
    border-left: 5px solid var(--primary-color);
    border-radius: var(--border-radius);
    background-color: #fff;
    transition: box-shadow 0.3s;
}

.aviso-item:hover {
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.aviso-content {
    flex-grow: 1;
    margin-right: 15px;
}

.aviso-id {
    font-weight: 700;
    color: var(--primary-color);
    display: block;
    margin-bottom: 5px;
}

.aviso-text {
    margin: 0 0 10px 0;
    white-space: pre-wrap; /* Mantiene saltos de línea del textarea */
}

.aviso-date {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.aviso-date i {
    margin-right: 5px;
}

.aviso-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

/* --- Estados Vacíos y Alertas --- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--secondary-color);
    background-color: #f1f1f1;
    border-radius: var(--border-radius);
    margin-top: 20px;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.alert {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-weight: 600;
    border-left: 5px solid;
}

.alert.success {
    background-color: #d4edda;
    color: var(--success-color);
    border-color: var(--success-color);
}

.alert.error {
    background-color: #f8d7da;
    color: var(--error-color);
    border-color: var(--error-color);
}

.alert.warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: var(--warning-color);
}

/* --- Nuevo contenedor para botones en el formulario --- */
.form-actions {
    display: flex;
    flex-wrap: wrap; /* Permite que los botones salten de línea en pantallas pequeñas */
    gap: 10px; /* Espacio entre los botones */
    margin-top: 20px;
}

/* El botón de Regresar debe usar el color secundario o uno nuevo para distinguirlo */
.btn-tertiary {
    background-color: #3498db; /* Un color distinto para el botón de regreso, ejemplo: celeste */
    color: white;
}

.btn-tertiary:hover {
    background-color: #2980b9;
    transform: scale(1.02);
}

/* Modificación para que los botones de acción se vean mejor en la lista */
.aviso-form .btn {
    margin-right: 0; /* Eliminamos el margin-right obsoleto */
}

/* --- Media Query: Ajustes para Móvil --- */
@media (max-width: 600px) {
    /* Los botones en el formulario ocuparán todo el ancho en móviles */
    .form-actions .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0; /* Ya no es necesario el margin-bottom gracias al gap */
    }
}

/* --- Media Queries para Responsividad (Móviles primero) --- */

@media (max-width: 600px) {
    .header h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 10px;
    }

    .form-section, .list-section {
        padding: 15px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .aviso-form .btn-primary,
    .aviso-form .btn-secondary {
        margin-right: 0;
    }

    .aviso-item {
        flex-direction: column; /* Apila el contenido y las acciones */
        align-items: flex-start;
    }

    .aviso-content {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 1px dashed #e9ecef;
    }

    .aviso-actions {
        width: 100%;
        justify-content: flex-end; /* Mueve los botones a la derecha en móviles */
    }
}