@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #F4F6F9;
    color: #1E293B;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Mapa ocupando todo el espacio disponible */
#map {
    flex-grow: 1;
    width: 100%;
    z-index: 1;
}

/* Menú Hamburguesa flotante */
.menu-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    width: 45px;
    height: 45px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4F46E5;
    transition: all 0.2s ease;
}

.menu-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Side Menu (SaaS Style Light/Minimalist) */
.side-menu {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1001;
    top: 0;
    right: 0;
    background-color: #ffffff;
    overflow-x: hidden;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 60px;
    box-shadow: -10px 0 25px -5px rgba(0,0,0,0.05);
    border-left: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.menu-profile {
    padding: 0 24px 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 15px;
}

.menu-profile-name {
    color: #1e293b;
    font-weight: 800;
    font-size: 16px;
    line-height: 1.3;
    word-break: break-word;
    text-transform: uppercase;
}

.menu-profile-company {
    color: #4F46E5;
    font-size: 12px;
    margin-top: 4px;
    word-break: break-word;
    font-weight: 600;
}

.side-menu a {
    padding: 14px 24px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    display: block;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f8fafc;
}

.side-menu a:hover {
    background-color: #f1f5f9;
    color: #4F46E5;
    padding-left: 28px;
}

/* Barra inferior fija */
.bottom-bar {
    display: flex;
    justify-content: space-around;
    background-color: #ffffff;
    padding: 12px 10px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.03);
    border-top: 1px solid #e2e8f0;
    z-index: 1000;
    gap: 8px;
}

.action-btn {
    flex: 1;
    padding: 12px 6px;
    border: none;
    border-radius: 12px;
    background-color: #4F46E5;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.1);
}

.action-btn:disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.action-btn:hover:not(:disabled) {
    background-color: #4338CA;
    transform: translateY(-1px);
}

@keyframes parpadeo {
    0% { background-color: #ef4444; box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
    50% { background-color: #b91c1c; box-shadow: 0 0 15px rgba(239, 68, 68, 0.8); }
    100% { background-color: #ef4444; box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
}

.parpadeando {
    animation: parpadeo 1.5s infinite;
    color: white !important;
}

/* Marcadores Numerados para Chofer */
.marker-numero {
    background-color: #4F46E5;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
    width: 32px !important;
    height: 32px !important;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    padding: 16px 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.02);
    border: 1px solid #e2e8f0;
    font-size: 12px;
}

.modal-content h2 {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 8px;
    text-align: center;
    text-shadow: none !important;
}

.modal-content p {
    font-size: 11px;
    color: #64748b;
    text-shadow: none !important;
    margin-bottom: 8px;
}

.close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 18px;
    font-weight: 400;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.15s ease;
}

.close-btn:hover {
    color: #1e293b;
}

.modal-content form,
.modal-content #dynamic-form-container,
.modal-content #dynamic-visita-container {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    margin-top: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    background-color: #ffffff;
    color: #1e293b;
    transition: all 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Botón de Cámara Personalizado */
.foto-btn-container {
    margin-top: 5px;
}
.foto-input-hidden {
    display: none !important;
}
.foto-btn-label {
    display: block;
    background-color: #f59e0b;
    color: white;
    padding: 12px;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 14px;
}
.foto-btn-label:hover {
    background-color: #d97706;
    transform: translateY(-1px);
}
.foto-btn-label.foto-tomada {
    background-color: #10b981;
}

.coords-display {
    background-color: #f1f5f9;
    padding: 10px;
    border-radius: 12px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: #10b981;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-submit:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

/* Acordeones para Grupos de Presentación (Marca, Precio, Foto) */
.presentation-group-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 12px;
    background-color: #fff9e6;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03);
    border-left: 4px solid #f59e0b;
}

.presentation-group-header {
    background-color: #fff9e6;
    color: #1e293b;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.presentation-group-header:hover {
    background-color: #ffedd5;
}

.presentation-group-toggle-icon {
    font-size: 12px;
    background: #f1f5f9;
    color: #64748b;
    padding: 3px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.presentation-group-header:hover .presentation-group-toggle-icon {
    background: #e2e8f0;
    color: #1e293b;
}

.presentation-group-filled {
    border-left: 4px solid #10b981 !important;
}

.presentation-group-filled .presentation-group-header {
    background-color: #ecfdf5;
}

.presentation-group-filled .presentation-group-header:hover {
    background-color: #d1fae5;
}

.presentation-group-body {
    padding: 16px;
    display: none;
    background-color: #fff9e6;
    border-top: 1px solid #f1f5f9;
}

.presentation-group-filled .presentation-group-body {
    background-color: #ecfdf5;
}

/* Panel flotante indicador de itinerario (Vendedor/Promotor) */
.itinerary-panel {
    display: none;
    position: fixed;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    background: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.03);
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
    border: 1px solid #fcd34d;
    border-left: 5px solid #f59e0b;
}

.itinerary-clear-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.itinerary-clear-btn:hover {
    background: #dc2626;
}

/* Estilos para el listado de tareas del itinerario */
.itinerary-panel-extended {
    flex-direction: column !important;
    align-items: stretch !important;
    border-radius: 12px !important;
    width: 290px !important;
    padding: 14px 18px !important;
}

.itinerary-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.itinerary-task-item:hover {
    background-color: #f1f5f9;
}

.itinerary-task-item.completed {
    color: #94a3b8;
    text-decoration: line-through;
}

.itinerary-task-item .task-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.itinerary-task-item .task-badge {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.itinerary-task-item.pending .task-badge {
    background-color: #fef3c7;
    color: #d97706;
}

.itinerary-task-item.completed .task-badge {
    background-color: #d1fae5;
    color: #065f46;
    text-decoration: none !important;
}
