/* CSS para el frontend */
.im-route-container {
    max-width: 500px;
    margin: 20px 0;
    font-family: Arial, sans-serif;
    color: #999;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Layout de 3 columnas para el widget completo */
.im-three-column-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    align-items: start;
}

.im-three-column-layout .im-route-container {
    margin: 0;
    max-width: none;
}

.im-three-column-layout .interactive-map-location {
    margin: 0;
    height: 400px;
}

.im-three-column-layout .im-info-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #999;
    height: fit-content;
}

/* Panel de información */
.im-info-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #999;
    margin: 20px 0;
}

.im-info-panel h3 {
    margin-top: 0;
    color: #666;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
    font-size: 18px;
}

.im-info-item {
    margin: 15px 0;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.im-info-item label {
    display: block;
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
    font-size: 14px;
}

.im-info-item .value {
    color: #999;
    font-size: 16px;
    word-break: break-word;
}

.im-info-item .coordinates {
    font-family: monospace;
    background: white;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-top: 5px;
}

.im-info-empty {
    text-align: center;
    color: #ccc;
    font-style: italic;
    padding: 40px 20px;
}

/* Indicadores de estado */
.im-info-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #0073aa;
}

.im-info-loading::before {
    content: "⏳";
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.im-info-success {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #46b450;
}

.im-info-success::before {
    content: "✅";
}

.im-info-error {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #dc3232;
}

.im-info-error::before {
    content: "❌";
}

/* Contenedor horizontal para múltiples shortcodes */
.im-horizontal-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.im-horizontal-container .im-route-container,
.im-horizontal-container .interactive-map-location {
    flex: 1;
    min-width: 300px;
    margin: 0;
}

/* Clase para disposición horizontal específica */
.im-side-by-side {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.im-side-by-side > * {
    flex: 1;
    min-width: 300px;
}

/* Desplegable de destinos */
.im-dropdown-container {
    margin-bottom: 20px;
}

.im-dropdown-container label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #999;
    font-size: 16px;
}

.im-dropdown {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    color: #999;
}

.im-dropdown:focus {
    border-color: #0073aa;
    outline: none;
}

/* Campo de entrada para origen */
.im-input-container {
    margin-bottom: 20px;
}

.im-input-container label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #999;
    font-size: 16px;
}

.input-with-geo {
    display: flex;
    gap: 8px;
}

.input-with-geo input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #999;
    background: white;
}

.input-with-geo input::placeholder {
    color: #ccc;
}

.input-with-geo input:focus {
    border-color: #0073aa;
    outline: none;
}

.im-geo-btn {
    padding: 12px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.im-geo-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

/* Botón principal */
.im-route-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.im-route-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Modal */
.im-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.im-modal-content {
    margin: 2% auto;
    width: 90%;
    max-width: 900px;
    height: 85%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.im-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.im-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Header del modal */
.modal-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    text-align: center;
}

.modal-header h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
}

.route-info {
    font-size: 14px;
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
}

.route-from,
.route-to {
    margin: 8px 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.route-from::before {
    content: "🚩";
    font-size: 16px;
}

.route-to::before {
    content: "📍";
    font-size: 16px;
}

.origin-text,
.dest-text {
    font-weight: bold;
}

/* Mapa */
.im-map {
    width: 100%;
    height: calc(100% - 120px);
    border: none;
}

/* Mapa de ubicación única */
.interactive-map-location {
    border-radius: 8px;
    border: 2px solid #ddd;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: white;
}

.interactive-map-location:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Mensajes de error/información */
p[style*="background: #f0f0f0"] {
    background: white !important;
    border: 2px solid #ddd !important;
    color: #999 !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .im-three-column-layout {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .im-three-column-layout .im-info-panel {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .im-route-container {
        max-width: 100%;
        padding: 15px;
    }
    
    .im-three-column-layout {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 10px;
    }
    
    .im-three-column-layout .im-info-panel {
        grid-column: span 1;
        order: 3;
    }
    
    .im-three-column-layout .interactive-map-location {
        order: 2;
        height: 300px;
    }
    
    .im-three-column-layout .im-route-container {
        order: 1;
    }
    
    /* En móviles, volver a vertical para otros layouts */
    .im-horizontal-container,
    .im-side-by-side {
        flex-direction: column;
        gap: 15px;
    }
    
    .im-horizontal-container .im-route-container,
    .im-horizontal-container .interactive-map-location,
    .im-side-by-side > * {
        flex: none;
        min-width: auto;
        width: 100%;
    }
    
    .im-modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .im-close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .input-with-geo {
        flex-direction: column;
    }
    
    .input-with-geo input,
    .im-geo-btn {
        width: 100%;
    }
    
    .route-info {
        font-size: 13px;
    }
    
    .route-from,
    .route-to {
        padding: 6px 10px;
        margin: 6px 0;
    }
    
    .im-dropdown-container label,
    .im-input-container label {
        font-size: 15px;
    }
    
    .im-info-panel {
        padding: 15px;
    }
    
    .im-info-item {
        margin: 10px 0;
        padding: 10px;
    }
}/* CSS mínimo para el frontend */
.im-route-container {
    max-width: 500px;
    margin: 20px 0;
    font-family: Arial, sans-serif;
}

/* Información de destino */
.destination-info {
    background: #e8f5e8;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #46b450;
    font-size: 14px;
    text-align: center;
}

/* Desplegable */
.im-dropdown-container {
    margin-bottom: 15px;
}

.im-dropdown-container label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.im-dropdown {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.im-dropdown:focus {
    border-color: #0073aa;
    outline: none;
}

/* Campo de entrada */
.im-input-container {
    margin-bottom: 20px;
}

.im-input-container label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.input-with-geo {
    display: flex;
    gap: 8px;
}

.input-with-geo input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.input-with-geo input:focus {
    border-color: #0073aa;
    outline: none;
}

.im-geo-btn {
    padding: 12px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.im-geo-btn:hover {
    background: #005a87;
    transform: translateY(-1px);
}

/* Botón principal */
.im-route-button {
    width: 100%;
    padding: 16px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.im-route-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Modal */
.im-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.im-modal-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 900px;
    height: 85%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.im-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
    background: rgba(255, 255, 255, 0.9);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.im-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Header del modal */
.modal-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    text-align: center;
}

.modal-header h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.route-info {
    font-size: 14px;
    opacity: 0.9;
}

.route-info .origin-text,
.route-info .dest-text {
    font-weight: bold;
}

/* Mapa */
.im-map {
    width: 100%;
    height: calc(100% - 80px);
    border: none;
}

/* Mapa de ubicación única */
.interactive-map-location {
    border-radius: 8px;
    border: 2px solid #ddd;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.interactive-map-location:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Responsive */
@media (max-width: 768px) {
    .im-route-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .im-modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .im-close {
        top: 10px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .input-with-geo {
        flex-direction: column;
    }
    
    .input-with-geo input,
    .im-geo-btn {
        width: 100%;
    }
    
    .destination-info {
        font-size: 13px;
    }
}