/* =========================================
   CALCULADORAS MÉDICAS FLOTANTES
   Estilo Premium & Glassmorphism
   ========================================= */

#calc-sidebar-container {
    position: fixed;
    right: 0;
    top: 15%;
    /* Height from top */
    z-index: 9999;
    display: flex;
    /* VISIBLE por defecto (pero su padre lo ocultara si es necesario) */
    flex-direction: row-reverse;
    align-items: flex-start;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

/* --- Botones Flotantes (Minimizado) --- */
.calc-buttons-strip {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 5px 10px 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 15px 0 0 15px;
    box-shadow: -4px 4px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-right: none;
    transition: transform 0.3s ease;
}

.calc-btn-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #00aced 0%, #0077b3 100%);
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 172, 237, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.calc-btn-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 172, 237, 0.6);
}

.calc-btn-toggle.active {
    background: white;
    color: #00aced;
    transform: translateX(-5px);
}

/* Tooltip for buttons */
.calc-btn-toggle::after {
    content: attr(title);
    position: absolute;
    right: 60px;
    background: rgba(34, 45, 50, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    transform: translateX(10px);
}

.calc-btn-toggle:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* --- Panel Principal (Expandido) --- */
#calc-main-panel {
    width: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 15px 0 0 15px;
    /* Border radius on left */
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: auto;
    max-height: 80vh;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

#calc-main-panel.open {
    width: 350px;
    /* Ancho del panel expandido */
    padding: 20px;
}

.calc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(0, 172, 237, 0.1);
    padding-bottom: 10px;
}

.calc-header h3 {
    margin: 0;
    font-size: 18px;
    color: #222d32;
    font-weight: 700;
}

.btn-close-calc {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-calc:hover {
    color: #ff5252;
}

/* --- Contenido de las Calculadoras --- */
.calc-content {
    display: none;
    /* Oculto por defecto */
    animation: fadeIn 0.4s ease;
}

.calc-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos de Inputs */
.calc-input-group {
    margin-bottom: 15px;
}

.calc-input-group label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    font-weight: 600;
}

.calc-input-group input[type="date"],
.calc-input-group input[type="number"],
.calc-input-group select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s;
}

.calc-input-group input:focus {
    outline: none;
    border-color: #00aced;
    box-shadow: 0 0 0 3px rgba(0, 172, 237, 0.1);
}

/* Resultados */
.calc-result-box {
    background: linear-gradient(135deg, f0f9ff 0%, #e1f5fe 100%);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    border: 1px solid rgba(0, 172, 237, 0.2);
    text-align: center;
}

.calc-result-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #0277bd;
    margin-bottom: 5px;
}

.calc-result-value {
    font-size: 24px;
    font-weight: 800;
    color: #01579b;
    margin-bottom: 5px;
}

.calc-result-sub {
    font-size: 13px;
    color: #546e7a;
}

/* Gestograma Visual */
.gesto-progress-container {
    margin-top: 15px;
    background: #e0e0e0;
    border-radius: 10px;
    height: 10px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.gesto-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    border-radius: 10px;
    width: 0%;
    transition: width 1s ease;
}

.gesto-week-markers {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #888;
    margin-top: 5px;
}