/* ===================================
   ESTILOS PARA PLANOS INTERACTIVOS
   =================================== */

/* Contenedor principal del plano */
#floor-plan-container {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
}

#floor-plan-container.active {
    display: block;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* SVG del plano */
.floor-plan-svg {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
}

/* Animación de ruta */
.route-animation {
    animation: dashAnimation 2s linear infinite;
}

@keyframes dashAnimation {
    to {
        stroke-dashoffset: -30;
    }
}

/* Consultorios resaltados */
.office.highlighted rect {
    filter: drop-shadow(0 0 10px rgba(76, 175, 80, 0.8));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 1;
    }
}

/* ===================================
   TARJETA DE INFORMACIÓN
   =================================== */

#office-info-card {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    z-index: 1001;
    overflow: hidden;
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#office-info-card.show {
    display: block;
}

#office-info-card.active {
    transform: translateX(0);
}

/* Header de la tarjeta */
.office-card-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.office-card-header h3 {
    margin: 0;
    color: white;
    font-size: 1.4em;
    font-weight: 600;
}

.office-card-header.error {
    background: rgba(231, 76, 60, 0.2);
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body de la tarjeta */
.office-card-body {
    padding: 20px;
    background: white;
    color: #333;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #666;
    flex-shrink: 0;
    margin-right: 10px;
}

.info-value {
    text-align: right;
    color: #333;
    font-weight: 500;
}

.info-row.instructions {
    flex-direction: column;
    align-items: flex-start;
}

.info-row.instructions .info-value {
    text-align: left;
    margin-top: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    width: 100%;
}

/* Mensajes especiales */
.not-found-message,
.error-message {
    text-align: center;
    padding: 20px;
}

.not-found-message p,
.error-message p {
    margin: 10px 0;
}

.error-message code {
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Footer de la tarjeta */
.office-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.btn-primary {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ===================================
   NAVEGACIÓN DE PISOS
   =================================== */

.floor-navigation {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.floor-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: #666;
}

.floor-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.floor-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    #floor-plan-container {
        width: 95%;
        height: 70vh;
    }

    #office-info-card {
        top: auto;
        bottom: 20px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }

    .office-card-header h3 {
        font-size: 1.2em;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-value {
        text-align: left;
        margin-top: 5px;
    }
}

/* ===================================
   OVERLAY DE FONDO
   =================================== */

.floor-plan-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
    backdrop-filter: blur(5px);
}

.floor-plan-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}