body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

#controls {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: row;
    gap: 3px;
    align-items: center;
}

.filter-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    text-align: left;
    white-space: nowrap;
    width: fit-content;
}

.filter-select {
    padding: 4px 12px 4px 4px;
    border: 2px solid #ced4da;
    border-radius: 4px;
    background-color: #fff;
    font-size: 0.9em;
    color: #495057;
    min-width: 120px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-select:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.filter-select:hover {
    border-color: #adb5bd;
}

.filter-separator {
    display: none;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

#map {
    height: calc(100% - 110px);
    width: 100%;
}

button {
    margin-left: 5px;
    padding: 0 5px;
    font-size: 1em;
    cursor: pointer;
}

.vacantes {
    transition: color 0.3s;
    display: inline-block;
    min-width: 30px;
    text-align: right;
}

.login-page {
    background: #f5f5f5;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: white;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.error-message {
    color: #ff4444;
    margin-bottom: 15px;
    text-align: center;
}

.admin-controls {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    min-width: fit-content;
}

.btn {
    font-family: Arial, sans-serif;
    font-size: 1em;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    white-space: nowrap;
    min-width: max-content;
    text-decoration: none;
    color: inherit;
    background: #f8f9fa;
}

.btn:hover {
    background: #e9ecef;
}

#fileInput, #guardarCambios, #mostrarAyuda {
    font-family: Arial, sans-serif;
    font-size: 1em;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: white;
    cursor: pointer;
    white-space: nowrap;
    min-width: max-content;
}

#guardarCambios, #mostrarAyuda {
    background: #f8f9fa;
    transition: background-color 0.2s;
}

#guardarCambios:hover, #mostrarAyuda:hover {
    background: #e9ecef;
}

.last-update {
    font-size: 0.85em;
    color: #6c757d;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    font-weight: 400;
    box-shadow: none;
    white-space: nowrap;
}

.help-btn {
    font-size: 0.9em;
    padding: 4px 10px;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.help-btn:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.help-btn i {
    font-size: 1.1em;
    color: #6c757d;
}

.resumen-container {
    position: absolute;
    right: 20px;
    top: 80px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 300px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.resumen-vacantes {
    margin-top: 10px;
}

.resumen-item {
    margin-bottom: 15px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 3px;
}

.resumen-item h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.resumen-curso {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    padding: 3px 0;
    border-bottom: 1px solid #ddd;
}

.aviso-mantenimiento {
    position: fixed;
    bottom: 66vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ef9a9a;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    max-width: 90%;
    width: 600px;
}

/* Estilo para el switch */
.maintenance-switch {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 10px 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #f32160;
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.switch-label {
    font-size: 0.9em;
    color: #666;
}

.leaflet-popup-content {
    width: 300px !important;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.leaflet-popup-content-wrapper {
    width: auto !important;
    min-width: 350px;
}

.leaflet-popup-content::-webkit-scrollbar {
    width: 8px;
}

.leaflet-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.vacancy-controls {
    display: inline-flex;
    flex-direction: column;
    margin-left: 2px;
    vertical-align: middle;
}

.vacancy-number-container {
    display: flex;
    align-items: center;
    gap: 2px;
    justify-content: flex-end;
    min-width: 100px;
}

.vacancy-text {
    text-align: right;
}

.vacancy-btn {
    padding: 0;
    width: 40px;
    height: 20px;
    line-height: 16px;
    font-size: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: block;
    margin: 0;
    text-align: center;
}

.vacancy-btn.plus {
    color: #28a745;
}

.vacancy-btn.plus:hover {
    color: #1e7e34;
}

.vacancy-btn.minus {
    color: #dc3545;
}

.vacancy-btn.minus:hover {
    color: #bd2130;
}

.map-legend {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background: white;
    padding: 12px 15px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    font-size: 13px;
    min-width: 180px;
    margin-right: 60px; /* Espacio para el botón de pantalla completa */
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    white-space: nowrap;
}

.legend-icon {
    width: 12px;
    height: 12px;
    margin-right: 10px;
    border-radius: 50%;
}

.legend-text {
    color: #333;
}

.help-btn {
    font-size: 0.9em;
    padding: 5px 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.help-btn:hover {
    background-color: #f8f9fa;
}

.help-btn i {
    font-size: 1.1em;
    color: #888;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 700px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 28px;
    font-weight: normal;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #333;
}

.modal-title {
    font-size: 1.8em;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    color: #2c3e50;
    font-weight: 600;
}

.help-section {
    margin-bottom: 30px;
    padding: 0 10px;
}

.help-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.help-section h4 {
    color: #34495e;
    margin: 20px 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
    padding-left: 15px;
}

.help-section h3::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 20px;
    background-color: #3498db;
    margin-right: 10px;
    border-radius: 2px;
}

.help-section p {
    color: #34495e;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1.05em;
}

.help-section ul {
    list-style-type: none;
    padding-left: 25px;
}

.help-section li {
    margin-bottom: 12px;
    position: relative;
    line-height: 1.5;
    color: #34495e;
}

.help-section li:before {
    content: "•";
    color: #3498db;
    position: absolute;
    left: -20px;
    font-size: 1.2em;
}

.help-section li strong {
    color: #2c3e50;
    font-weight: 600;
}

/* Estilo para el scrollbar del modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

.site-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header h1 {
    margin: 0;
    font-size: 1.6em;
    font-weight: 500;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-links a {
    color: white;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.header-links a:hover {
    color: #3498db;
}

.separator {
    color: #bdc3c7;
    font-weight: normal;
}

.curso-buttons {
    display: flex;
    gap: 2px;
    align-items: center;
    background-color: #fff;
    padding: 2px 6px 2px 0px;
    border-radius: 6px;
    border: 2px solid #ced4da;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.curso-btn {
    padding: 4px 8px;
    border: none;
    background-color: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #495057;
    min-width: 40px;
}

.curso-btn:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.curso-btn.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.3);
    transform: translateY(-1px);
}

.curso-btn.active:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
}

.curso-btn:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
    border: 1px solid #e9ecef;
}

.curso-btn:disabled:hover {
    background-color: #f8f9fa;
    color: #6c757d;
    transform: none;
    box-shadow: none;
}

/* Control de pantalla completa */
.fullscreen-control {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-bottom: 5px;
    margin-right: 5px;
}

.fullscreen-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #dee2e6;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 16px;
    color: #495057;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fullscreen-btn i {
    transition: transform 0.3s ease;
}

.fullscreen-btn:hover i {
    transform: scale(1.1);
}

/* Estilos para modo pantalla completa */
.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
}

.fullscreen-mode .site-header,
.fullscreen-mode #controls {
    display: none !important;
}

.fullscreen-mode .map-legend {
    display: none !important;
}

/* Ajustes para móvil en modo pantalla completa */
@media (max-width: 768px) {
    .fullscreen-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
        background: rgba(255, 255, 255, 0.95);
        border-width: 3px;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    }
    
    .fullscreen-mode {
        /* En móvil, el mapa ocupa toda la pantalla */
        height: 100vh !important;
        height: 100dvh !important; /* Para navegadores que soportan dvh */
    }
    
    /* Hacer el botón más visible en móvil cuando está en pantalla completa */
    .fullscreen-mode .fullscreen-btn {
        background: rgba(220, 53, 69, 0.9);
        color: white;
        border-color: #dc3545;
        width: 55px;
        height: 55px;
        font-size: 22px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    
    .fullscreen-mode .fullscreen-btn:hover {
        background: rgba(220, 53, 69, 1);
        border-color: #c82333;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Ocultar leyenda en móvil */
    .map-legend {
        display: none !important;
    }
    
    #controls {
        padding: 12px 15px;
        gap: 15px;
    }
    
    .filter-section {
        gap: 10px;
        width: 100%;
        justify-content: flex-start;
    }
    
    .filter-group {
        flex-direction: row;
        align-items: center;
        gap: 3px;
    }
    
    .filter-select {
        min-width: 100px;
        font-size: 0.85em;
    }
    
    .filter-separator {
        display: none;
    }
    
    .controls-right {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
        margin-top: 10px;
    }
    
    .last-update {
        font-size: 0.8em;
        padding: 0;
    }
    
    .help-btn {
        font-size: 0.85em;
        padding: 3px 8px;
    }
    
    .curso-buttons {
        gap: 2px;
        padding: 3px 8px 3px 0px;
    }
    
    .curso-btn {
        padding: 3px 6px;
        font-size: 0.8em;
        min-width: 35px;
    }
}

@media (max-width: 480px) {
    #controls {
        padding: 10px;
        gap: 10px;
    }
    
    .filter-section {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 3px;
    }
    
    .filter-label {
        font-size: 0.8em;
        width: fit-content;
        text-align: left;
    }
    
    .filter-select {
        flex: 1;
        min-width: auto;
    }
    
    .filter-separator {
        display: none;
    }
    
    .curso-buttons {
        justify-content: flex-start;
    }
}
