/* Custom animations and specific layout overrides */

/* Hide scrollbar for event log but keep functionality */
#event-log::-webkit-scrollbar {
    width: 6px;
}
#event-log::-webkit-scrollbar-track {
    background: transparent;
}
#event-log::-webkit-scrollbar-thumb {
    background-color: #334155;
    border-radius: 10px;
}

/* Tooltip basic implementation */
.tooltip {
    position: relative;
    cursor: help;
}
.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    border: 1px solid #475569;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Cylinder styling */
.cylinder {
    width: 40px;
    height: 100px;
    border-radius: 20px 20px 4px 4px;
    position: relative;
    display: flex;
    justify-content: center;
    box-shadow: inset -5px 0 15px rgba(0,0,0,0.5), 2px 2px 5px rgba(0,0,0,0.3);
}

.cylinder::before {
    content: '';
    position: absolute;
    top: -10px;
    width: 12px;
    height: 10px;
    background-color: #94a3b8;
    border-radius: 2px 2px 0 0;
}

.cylinder.o2 {
    background: linear-gradient(to right, #000000 0%, #1a1a1a 100%);
}
.cylinder.o2::after {
    /* White shoulder for O2 (UK/International) or Green (US) - using white for contrast */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    background-color: #ffffff;
    border-radius: 20px 20px 0 0;
    box-shadow: inset -5px 0 15px rgba(0,0,0,0.2);
}

.cylinder.n2o {
    background-color: #3b82f6;
    box-shadow: inset -5px 0 15px rgba(0,0,0,0.3), 2px 2px 5px rgba(0,0,0,0.3);
}

.cylinder.vac {
    background: linear-gradient(to right, #b45309 0%, #d97706 100%);
    box-shadow: inset -5px 0 15px rgba(0,0,0,0.3), 2px 2px 5px rgba(0,0,0,0.3);
}

.cylinder.vac::before {
    background-color: #fbbf24;
}

.cylinder.vac::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 25px;
    background-color: #fbbf24; /* Yellow top shoulder for vacuum (international standard) */
    border-radius: 20px 20px 0 0;
    box-shadow: inset -5px 0 15px rgba(0,0,0,0.2);
}

.cylinder span {
    position: absolute;
    bottom: -15px;
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

/* Sensor Nodes */
.sensor-node {
    position: absolute;
    top: -14px;
    width: 12px;
    height: 12px;
    background-color: #0d9488;
    border: 2px solid #14b8a6;
    border-radius: 50%;
    z-index: 10;
    box-shadow: 0 0 10px #14b8a6;
    transition: all 0.3s ease;
}
.sensor-node.alert {
    background-color: #dc2626;
    border-color: #ef4444;
    box-shadow: 0 0 15px #ef4444;
    animation: pulse-alert 1s infinite;
}

@keyframes pulse-alert {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Pipes and Flow */
.pipe {
    position: absolute;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    overflow: hidden;
}

.pipe-main-o2 {
    top: calc(50% - 126px);
    left: 60px;
    right: 280px;
    height: 6px;
    z-index: 1;
}

.pipe-main-n2o {
    top: calc(50% - 2px);
    left: 60px;
    right: 280px;
    height: 6px;
    z-index: 1;
}

.pipe-main-vac {
    top: calc(50% + 122px);
    left: 60px;
    right: 280px;
    height: 6px;
    z-index: 1;
}

.flow-anim {
    width: 200%;
    height: 100%;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 5px,
        rgba(255,255,255,0.2) 5px,
        rgba(255,255,255,0.2) 10px
    );
    animation: flowLine 2s linear infinite;
    opacity: 0; /* Hidden by default until simulation runs */
    transition: opacity 0.5s;
}

.flow-anim.active {
    opacity: 1;
}

.o2-flow {
    background-color: rgba(34, 197, 94, 0.4); /* Greenish for O2 flow */
}
.n2o-flow {
    background-color: rgba(59, 130, 246, 0.4); /* Blueish for N2O */
}
.vac-flow {
    background-color: rgba(245, 158, 11, 0.4); /* Amber suction flow */
}

@keyframes flowLine {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

/* Log Entries */
.log-entry {
    padding: 8px 12px;
    border-bottom: 1px solid #334155;
    font-size: 11px;
    animation: slideIn 0.3s ease-out forwards;
    display: flex;
    gap: 8px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #64748b;
    font-family: monospace;
    white-space: nowrap;
}

.log-msg {
    color: #cbd5e1;
}

.log-entry.info .log-icon { color: #3b82f6; }
.log-entry.success .log-icon { color: #10b981; }
.log-entry.warning .log-icon { color: #f59e0b; }
.log-entry.danger .log-icon { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.log-entry.danger { border-left: 2px solid #ef4444; background: rgba(239, 68, 68, 0.05);}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Data value updates highlight */
.value-update {
    animation: highlightUpdate 0.5s ease-out;
}

@keyframes highlightUpdate {
    0% { color: #fff; text-shadow: 0 0 10px #fff; }
    100% { color: inherit; text-shadow: none; }
}