/* ============================================================================
 * mapa_procesos.css — Estilos del Mapa de Procesos (IPS MEDCARE)
 *
 * Autocontenido: reproduce el diseno original del mapa sin depender del tema
 * del portal. Se usa tanto en mapa_procesos.html como en la vista de prueba.
 * Extraido de mapa_procesos.html para evitar duplicacion.
 * ==========================================================================*/

  /* Reset acotado para evitar interferencias con el tema del portal */
  .medcare-map-container * { box-sizing: border-box; margin: 0; padding: 0; }

  .medcare-map-container {
    display: block;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #dce8f2;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px;
    border-radius: 8px;
  }

  /* ANIMACIONES */
  @keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
  @keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
  @keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.02); } }
  @keyframes glow {
    0% { box-shadow: 0 0 0 rgba(26,95,158,0); }
    50% { box-shadow: 0 0 15px rgba(26,95,158,0.3); }
    100% { box-shadow: 0 0 0 rgba(26,95,158,0); }
  }
  @keyframes arrowPulse { 0%,100% { opacity: .5; transform: translateX(0); } 50% { opacity: 1; transform: translateX(3px); } }
  @keyframes arrowPulseLeft { 0%,100% { opacity: .5; transform: translateX(0); } 50% { opacity: 1; transform: translateX(-3px); } }

  .medcare-map-container .section { animation: fadeInUp .6s ease-out forwards; opacity: 0; }
  .medcare-map-container .section:nth-child(1) { animation-delay: .2s; }
  .medcare-map-container .section:nth-child(3) { animation-delay: .4s; }
  .medcare-map-container .section:nth-child(5) { animation-delay: .6s; }
  .medcare-map-container .section:nth-child(7) { animation-delay: .8s; }
  .medcare-map-container .side-left { animation: slideInLeft .5s ease-out .1s forwards; opacity: 0; }
  .medcare-map-container .side-right { animation: slideInRight .5s ease-out .1s forwards; opacity: 0; }
  .medcare-map-container .hub-box { animation: pulse 3s ease-in-out infinite, glow 3s ease-in-out infinite; }

  .medcare-map-container .arrow-right-blue,
  .medcare-map-container .arrow-left-blue,
  .medcare-map-container .arr-left,
  .medcare-map-container .arr-right,
  .medcare-map-container .v-arr-up,
  .medcare-map-container .v-arr-down { animation: arrowPulse 2s ease-in-out infinite; }
  .medcare-map-container .arrow-left-blue { animation: arrowPulseLeft 2s ease-in-out infinite; }

  .medcare-map-container .box-blue,
  .medcare-map-container .arrow-process,
  .medcare-map-container .box-gray,
  .medcare-map-container .eval-box { transition: all .3s ease; }
  .medcare-map-container .box-blue:hover,
  .medcare-map-container .arrow-process:hover,
  .medcare-map-container .box-gray:hover,
  .medcare-map-container .eval-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
    filter: brightness(1.1);
    cursor: pointer;
  }

  .medcare-map-container a,
  .medcare-map-container .modal-trigger {
    text-decoration: none;
    color: inherit;
    display: block;
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* LAYOUT */
  .medcare-map-container .main-layout { display: flex; flex: 1; gap: 0; margin-top: 0; }
  .medcare-map-container .side-left,
  .medcare-map-container .side-right { width: 46px; display: flex; align-items: center; justify-content: center; position: relative; }
  .medcare-map-container .side-text-left,
  .medcare-map-container .side-text-right {
    writing-mode: vertical-rl;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #1a5f9e;
    padding: 14px 8px;
    text-align: center;
    letter-spacing: 1px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.4;
    transition: background .3s ease;
  }
  .medcare-map-container .side-text-left { transform: rotate(180deg); }
  .medcare-map-container .side-text-left:hover,
  .medcare-map-container .side-text-right:hover { background: #0d3b63; }

  .medcare-map-container .center-content { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 0 10px; }

  /* SECCIONES */
  .medcare-map-container .section { border-radius: 4px; overflow: hidden; transition: box-shadow .3s ease; }
  .medcare-map-container .section:hover { box-shadow: 0 8px 20px rgba(0,0,0,.15); }
  .medcare-map-container .section-header {
    font-size: 13px;
    font-weight: 800;
    padding: 6px 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.4;
    transition: background .3s ease;
  }
  .medcare-map-container .section-header:hover { filter: brightness(1.1); }
  .medcare-map-container .section-body { padding: 12px; }

  .medcare-map-container .section-estrategicos { border: 2px solid #3a87c8; background: #f0f7ff; }
  .medcare-map-container .section-estrategicos .section-header { background: #3a7fc1; }
  .medcare-map-container .section-misionales { border: 2px solid #4caf50; background: #f1fbf2; }
  .medcare-map-container .section-misionales .section-header { background: #388e3c; }
  .medcare-map-container .section-apoyo { border: 2px solid #757575; background: #f7f7f7; }
  .medcare-map-container .section-apoyo .section-header { background: #616161; }
  .medcare-map-container .section-eval { border: 2px solid #e67e22; background: #fff8f2; }
  .medcare-map-container .section-eval .section-header { background: #e67e22; }

  .medcare-map-container .box-blue {
    background: #5aacde;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 4px;
    text-align: center;
    line-height: 1.4;
    font-family: 'Segoe UI', Arial, sans-serif;
  }
  .medcare-map-container .hub-box {
    background: #2b7bc8;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 16px 20px;
    border-radius: 4px;
    text-align: center;
    line-height: 1.4;
    min-width: 140px;
    position: relative;
    z-index: 2;
    font-family: 'Segoe UI', Arial, sans-serif;
  }

  .medcare-map-container .arrow-right-blue {
    width: 0; height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 10px solid #5aacde;
    display: inline-block; vertical-align: middle; margin-left: -1px;
  }
  .medcare-map-container .arrow-left-blue {
    width: 0; height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 10px solid #2b7bc8;
    display: inline-block; vertical-align: middle; margin-right: -1px;
  }

  .medcare-map-container .misionales-flow { display: flex; align-items: center; gap: 0; }
  .medcare-map-container .arrow-process {
    flex: 1;
    background: #4caf50;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 16px 12px 16px 24px;
    text-align: center;
    line-height: 1.4;
    position: relative;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
    margin-right: 4px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Segoe UI', Arial, sans-serif;
  }
  .medcare-map-container .arrow-process:first-child { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); padding-left: 12px; }
  .medcare-map-container .arrow-process:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 14px 50%); margin-right: 0; }

  .medcare-map-container .apoyo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .medcare-map-container .box-gray {
    background: #757575;
    color: #fff;
    font-size: 10.5px;
    font-weight: 600;
    padding: 12px 10px;
    border-radius: 4px;
    text-align: center;
    line-height: 1.4;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
    display: flex; align-items: center; justify-content: center;
    min-height: 60px;
    font-family: 'Segoe UI', Arial, sans-serif;
  }
  .medcare-map-container .box-gray:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); }
  .medcare-map-container .box-gray:last-child { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 10px 50%); }

  .medcare-map-container .eval-flow { display: flex; align-items: center; justify-content: center; gap: 0; }
  .medcare-map-container .eval-box {
    background: #e67e22;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 16px 24px;
    border-radius: 4px;
    text-align: center;
    min-width: 140px;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.4;
  }
  .medcare-map-container .arr-left { width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-right: 12px solid #e67e22; }
  .medcare-map-container .arr-right { width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 12px solid #e67e22; }
  .medcare-map-container .arr-line { height: 2px; width: 32px; background: #e67e22; }

  .medcare-map-container .indicator-text {
    font-size: 10.5px;
    color: #444;
    font-style: italic;
    margin-top: 10px;
    padding: 0 2px;
    line-height: 1.5;
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: color .3s ease;
  }
  .medcare-map-container .indicator-text:hover { color: #1a5f9e; }

  .medcare-map-container .v-arrows { display: flex; justify-content: center; align-items: center; gap: 8px; height: 22px; margin: 4px 0; }
  .medcare-map-container .v-arr-up { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 12px solid #3a7fc1; }
  .medcare-map-container .v-arr-down { width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid #3a7fc1; }

  .medcare-map-container .est-full { display: flex; align-items: center; gap: 10px; width: 100%; }
  .medcare-map-container .est-left-col,
  .medcare-map-container .est-right-col { display: flex; flex-direction: column; gap: 8px; flex: 1; }
  .medcare-map-container .h-connector { display: flex; align-items: center; }
  .medcare-map-container .h-line { height: 2px; background: #5aacde; width: 25px; }
  .medcare-map-container .h-line-r { height: 2px; background: #2b7bc8; width: 25px; }

  /* ===== OVERLAY DE ACCESO (dentro del contenedor del mapa) ===== */
  #mapContainer { position: relative; overflow: hidden; }
  .map-blur { filter: blur(6px); pointer-events: none; user-select: none; }
  .map-password-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(2px);
    display: flex; justify-content: center; align-items: center;
    z-index: 10;
  }
  .password-card {
    background: #fff;
    padding: 30px 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
    max-width: 360px;
    width: 90%;
    animation: fadeInUp .3s ease-out;
  }
  .password-card h2 { font-weight: 600; margin-bottom: 20px; color: #2c3e50; font-size: 1.2rem; }
  .password-card input {
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: .95rem;
    outline: none;
    transition: border .2s;
  }
  .password-card input:focus { border-color: #3a7fc1; }
  .password-card button {
    background: #3a7fc1;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    margin: 0 5px;
  }
  .password-card button:hover { background: #2b6aa5; }
  .password-card .cancel-btn { background: #aaa; }
  .password-card .cancel-btn:hover { background: #888; }
  .password-error { color: #c0392b; font-size: .8rem; margin-top: 8px; display: none; }
