/* 🔹 Layout base - Sticky Footer */
/* 🔹 Sección de resultados (columna derecha) */
/* 🔹 Ocultar botón de imprimir permanentemente */
#btnImprimirInline,
.btn-print-inline {
    display: none !important;
}
.result-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

/* 🔹 Placeholder inicial */
.placeholder-result {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 350px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.placeholder-result i {
    opacity: 0.4;
    transition: all 0.3s;
}

.placeholder-result:hover i {
    opacity: 0.6;
    transform: scale(1.1);
}

/* 🔹 Instrucciones en formulario */
.instrucciones-box {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

/* 🔹 Timeline inline optimizado para columna derecha */
.timeline-inline {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    border-left: 4px solid #3498db;
    animation: fadeInRight 0.4s ease;
}

@keyframes fadeInRight {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.timeline-header-inline {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.timeline-header-inline strong {
    font-size: 16px;
}

.timeline-header-inline small {
    opacity: 0.9;
}

.timeline-vertical {
    position: relative;
    padding-left: 40px;
    margin: 20px 0;
}

.timeline-vertical::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    background: linear-gradient(to bottom, #3498db, #f39c12, #2ecc71);
    border-radius: 3px;
}

.timeline-step {
    position: relative;
    margin-bottom: 25px;
    padding-left: 25px;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 4px solid white;
    background: #3498db;
    z-index: 1;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.timeline-step.completed::before {
    background: #2ecc71;
    box-shadow: 0 0 0 4px #2ecc71, 0 4px 12px rgba(46, 204, 113, 0.4);
}

.timeline-step.pending::before {
    background: #f39c12;
    box-shadow: 0 0 0 4px #f39c12, 0 4px 12px rgba(243, 156, 18, 0.4);
    animation: pulse 2s infinite;
}

.timeline-step.rejected::before {
    background: #e74c3c;
    box-shadow: 0 0 0 4px #e74c3c, 0 4px 12px rgba(231, 76, 60, 0.4);
}

.timeline-step-content {
    background: white;
    padding: 16px 20px;
    border-radius: 10px;
    border-left: 4px solid #3498db;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.timeline-step-content:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.timeline-step.completed .timeline-step-content { 
    border-left-color: #2ecc71; 
    background: linear-gradient(to right, #ffffff, #f0fff4);
}

.timeline-step.pending .timeline-step-content { 
    border-left-color: #f39c12;
    background: linear-gradient(to right, #ffffff, #fffbeb);
}

.timeline-step.rejected .timeline-step-content { 
    border-left-color: #e74c3c;
    background: linear-gradient(to right, #ffffff, #fef2f2);
}

.timeline-step-title {
    font-weight: 700;
    font-size: 15px;
    color: #2c3e50;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-step-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
    display: block;
    font-weight: 500;
}

.timeline-step-desc {
    font-size: 13px;
    color: #495057;
    line-height: 1.5;
}

.timeline-step-meta {
    font-size: 12px;
    color: #3498db;
    margin-top: 8px;
    font-weight: 600;
    padding-top: 8px;
    border-top: 1px dashed #dee2e6;
}

/* 🔹 Acciones del timeline */
.timeline-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-timeline-action {
    padding: 10px 22px;
    border: none;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
}

.btn-print-inline {
    background: white;
    color: #3498db;
    border: 2px solid #3498db;
}
.btn-print-inline:hover { 
    background: #3498db; 
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-refresh-inline {
    background: #6c757d;
    color: white;
}
.btn-refresh-inline:hover { 
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* 🔹 Responsive */
@media (max-width: 991px) {
    .result-section {
        min-height: auto;
        margin-top: 20px;
    }
    
    .timeline-vertical {
        padding-left: 35px;
    }
    
    .timeline-step::before {
        left: -26px;
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 576px) {
    .timeline-actions {
        flex-direction: column;
    }
    
    .btn-timeline-action {
        width: 100%;
        justify-content: center;
    }
    
    .timeline-header-inline {
        text-align: center;
        align-items: center;
    }
}

/* 🔹 Loading en resultado */
.result-loading {
    text-align: center;
    padding: 60px 20px;
}

.result-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 🔹 Contenido principal ocupa el espacio disponible */
main, #contacto {
    flex: 1 0 auto;
    width: 100%;
}

/* 🔹 Footer siempre abajo */
footer {
    flex-shrink: 0;
    width: 100%;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    margin-top: auto; /* 🔑 Clave para sticky footer */
}

/* 🔹 Sección de tracker */
.tracker-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    margin-bottom: 0; /* Evita espacio extra */
}

.tracker-section h3 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 🔹 Input group del tracker */
.tracker-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tracker-input-group input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tracker-input-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.tracker-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.tracker-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.tracker-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* 🔹 Mensajes de estado */
.tracker-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.tracker-message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.tracker-message.error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.tracker-message.warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.tracker-message.info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* 🔹 Loading spinner */
.tracker-loading {
    text-align: center;
    padding: 25px;
    color: #6c757d;
}

.tracker-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e9ecef;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 🔹 Timeline inline */
#timelineResult {
    display: none;
    margin-top: 20px;
    animation: slideDown 0.3s ease;
}

#timelineResult.show {
    display: block;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); max-height: 0; }
    to { opacity: 1; transform: translateY(0); max-height: 1000px; }
}

.timeline-inline {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #3498db;
}

.timeline-vertical {
    position: relative;
    padding-left: 35px;
    margin: 15px 0;
}

.timeline-vertical::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 20px;
    bottom: 20px;
    width: 3px;
    background: linear-gradient(to bottom, #3498db, #f39c12, #2ecc71);
    border-radius: 2px;
}

.timeline-step {
    position: relative;
    margin-bottom: 22px;
    padding-left: 20px;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid white;
    background: #3498db;
    z-index: 1;
    transition: all 0.3s;
}

.timeline-step.completed::before {
    background: #2ecc71;
    box-shadow: 0 0 0 3px #2ecc71, 0 0 12px rgba(46, 204, 113, 0.4);
}

.timeline-step.pending::before {
    background: #f39c12;
    box-shadow: 0 0 0 3px #f39c12, 0 0 12px rgba(243, 156, 18, 0.4);
    animation: pulse 1.5s infinite;
}

.timeline-step.rejected::before {
    background: #e74c3c;
    box-shadow: 0 0 0 3px #e74c3c, 0 0 12px rgba(231, 76, 60, 0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.timeline-step-content {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #3498db;
    transition: transform 0.2s, box-shadow 0.2s;
}

.timeline-step-content:hover {
    transform: translateX(4px);
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.timeline-step.completed .timeline-step-content { border-left-color: #2ecc71; }
.timeline-step.pending .timeline-step-content { border-left-color: #f39c12; }
.timeline-step.rejected .timeline-step-content { border-left-color: #e74c3c; }

.timeline-step-title {
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-step-date {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 5px;
    display: block;
}

.timeline-step-desc {
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
}

.timeline-step-meta {
    font-size: 12px;
    color: #3498db;
    margin-top: 5px;
    font-weight: 500;
}

/* 🔹 Acciones del timeline */
.timeline-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-timeline-action {
    padding: 8px 18px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-print-inline {
    background: white;
    color: #3498db;
    border: 2px solid #3498db;
}
.btn-print-inline:hover { background: #3498db; color: white; }

.btn-refresh-inline {
    background: #6c757d;
    color: white;
}
.btn-refresh-inline:hover { background: #5a6268; }

/* 🔹 Footer styles */
footer {
    background: linear-gradient(135deg, #1a252f, #2c3e50);
    color: #ecf0f1;
    padding: 40px 0 20px;
}

footer h4 {
    color: white;
    font-size: 16px;
    margin-bottom: 15px;
}

footer p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 0;
}

footer ul.list-unstyled {
    padding: 0;
    margin: 0;
}

footer ul.list-unstyled li {
    margin-bottom: 8px;
}

footer a.footer-link {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.2s;
}

footer a.footer-link:hover {
    color: white;
    text-decoration: none;
}

footer .social-icon {
    color: #bdc3c7;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

footer .social-icon:hover {
    color: #3498db;
    transform: translateY(-3px);
}

footer hr {
    border-color: rgba(255,255,255,0.1);
    margin: 20px 0;
}

/* 🔹 Map container - evita distorsión */
.map-responsive {
    position: relative;
    padding-bottom: 75%; /* Ratio 4:3 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.map-responsive iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 12px;
}

/* Placeholder cuando no hay mapa */
.map-placeholder {
    text-align: center;
    color: #6c757d;
    padding: 20px;
}

.map-placeholder i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 10px;
}

/* 🔹 Responsive adjustments */
@media (max-width: 991px) {
    .tracker-input-group {
        flex-direction: column;
    }
    
    .tracker-btn {
        width: 100%;
        justify-content: center;
    }
    
    .timeline-actions {
        flex-direction: column;
    }
    
    .btn-timeline-action {
        width: 100%;
        justify-content: center;
    }
    
    .map-responsive {
        padding-bottom: 100%; /* Ratio 1:1 en móviles */
        min-height: 250px;
    }
}

@media (max-width: 576px) {
    .tracker-section {
        padding: 20px 15px;
    }
    
    .timeline-vertical {
        padding-left: 30px;
    }
    
    .timeline-step::before {
        left: -24px;
        width: 16px;
        height: 16px;
    }
    
    footer .row > div {
        text-align: center !important;
        margin-bottom: 20px;
    }
    
    footer .d-flex.justify-content-center {
        justify-content: center !important;
    }
}

/* 🔹 Utilidades adicionales */
.text-center { text-align: center !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }