/* Estilos generales */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 24px;
}

nav ul li a {
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
    color: #007bff;
}

main {
    padding: 40px 0;
}

h2 {
    color: #333;
    margin-bottom: 24px;
    font-weight: 600;
}

/* Tablas */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 32px;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.data-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.data-table tr:hover {
    background-color: #e9ecef;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #bd2130;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Avatares e iconos */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Footer */
footer {
    background-color: #f8f9fa;
    color: #6c757d;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
    font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    header .container {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        margin-top: 15px;
    }

    .data-table {
        font-size: 0.9rem;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

.map-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.map-grid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 500px; /* Ancho fijo para el contenedor del mapa */
}

.actions {
    width: 100%;
    margin-bottom: 10px;
}

.map-grid {
    width: 500px;
    height: 500px;
    display: grid;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
}

.map-cell {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
    overflow: hidden;
}

.map-cell img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.navigation-controls {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.navigation-controls button {
    padding: 10px;
    font-size: 18px;
    cursor: pointer;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.navigation-controls button:hover {
    background-color: #e0e0e0;
}

.cell-info {
    flex-grow: 1;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Estilos para los iconos de eventos y enemigos */
.map-cell .event-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 50%;
    max-height: 50%;
    z-index: 2;
}

.map-cell .enemy-icon {
    position: absolute;
    bottom: 5%;
    right: 5%;
    max-width: 30%;
    max-height: 30%;
    z-index: 1;
}

/* Estilos para las coordenadas */
.map-cell .coords-label {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 10px;
    color: black;
    text-shadow: 1px 1px 1px white;
    z-index: 3;
}

/* Estilo para la celda seleccionada */
.map-cell.selected {
    box-shadow: inset 0 0 0 3px #007bff;
}

/* Estilos para el selector de terreno y enemigos */
.terrain-selector, .enemy-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.terrain-option, .enemy-option {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.terrain-option img, .enemy-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.terrain-option.selected, .enemy-option.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Mensaje de guardado */
#save-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #28a745;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    display: none;
    z-index: 1000;
}