/* Main Container */
.ftl-container {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* Header */
.ftl-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ftl-icon {
    font-size: 1.5em;
    vertical-align: middle;
}

.ftl-subtitle {
    color: #666;
    font-size: 0.9em;
    margin-top: 0.5rem;
}

/* Control Panel */
.ftl-control-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ftl-control-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ftl-control-card h3 {
    margin-top: 0;
    font-size: 1rem;
    color: #444;
}

.ftl-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

/* Workspace */
.ftl-workspace-container {
    margin-bottom: 1.5rem;
}

.ftl-workspace {
    width: 100%;
    height: 400px;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%, #f1f5f9),
                      linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%, #f1f5f9);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
     position: relative;
}

.ftl-workspace-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #94a3b8;
    text-align: center;
}

/* Buttons */
.ftl-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.ftl-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ftl-button-primary {
    background-color: #3b82f6;
    color: white;
}

.ftl-button-primary:hover {
    background-color: #2563eb;
}

.ftl-button {
    background-color: #e2e8f0;
}

.ftl-button:hover {
    background-color: #cbd5e1;
}

/* Results Panel */
.ftl-results-panel {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ftl-results-panel h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.ftl-result {
    min-height: 60px;
    padding: 0.5rem;
}

.ftl-placeholder {
    color: #94a3b8;
    font-style: italic;
    margin: 0;
}

/* Draggable Elements */
.draggable {
    position: absolute;
    cursor: grab;
    user-select: none;
    z-index: 10;
    transition: transform 0.1s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.draggable:active {
    cursor: grabbing;
    transform: scale(1.05);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
}

/* Test Tube Liquid Animation */
#test-liquid {
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
    .ftl-control-panel {
        grid-template-columns: 1fr;
    }
    
    .ftl-workspace {
        height: 300px;
    }
}
@keyframes bubble-rise {
    0% {
        transform: translateY(0);
        opacity: 0.7;
    }
    100% {
        transform: translateY(-120px);
        opacity: 0;
    }
}@keyframes bubble-rise {
    0% {
        transform: translateY(0);
        opacity: 0.7;
    }
    100% {
        transform: translateY(-120px);
        opacity: 0;
    }
}

.ftl-fade-in {
    animation: ftl-fadeIn 0.3s ease-in forwards;
}

.ftl-fade-out {
    animation: ftl-fadeOut 0.2s ease-out forwards;
}

@keyframes ftl-fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes ftl-fadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}

.ftl-result-success {
    color: #2e7d32;
    background: #e8f5e9;
    padding: 10px;
    border-radius: 4px;
}

.ftl-result-error {
    color: #c62828;
    background: #ffebee;
    padding: 10px;
    border-radius: 4px;
}.ftl-workspace-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #94a3b8;
    text-align: center;
    pointer-events: none; /* Add this to prevent interfering with drag operations */
    display: none; /* Start hidden by default */
}

.ftl-workspace.has-items .ftl-workspace-guide {
    display: none; /* Ensure guide stays hidden when items are present */
}

.ftl-workspace:not(.has-items) .ftl-workspace-guide {
    display: block; /* Show guide only when no items */
}.ftl-workspace {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #f0f8ff;
    border: 2px dashed #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.draggable {
    cursor: grab;
    user-select: none;
    width: 100px;
    z-index: 10;
}

.draggable:active {
    cursor: grabbing;
    z-index: 100;
}

.ftl-workspace-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    text-align: center;
    pointer-events: none;
}

.ftl-workspace {
    position: relative;
    width: 100%;
    height: 400px;
    background-color: #f0f8ff;
    border: 2px dashed #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.draggable {
    cursor: grab;
    user-select: none;
    width: 100px;
    z-index: 10;
    transition: transform 0.2s ease;
}

.draggable:active {
    cursor: grabbing;
    z-index: 100;
}

.ftl-workspace-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    text-align: center;
    pointer-events: none;
}

/* Dropper specific styling */
.chemical {
    width: 80px;
    z-index: 20; /* Above other elements */
}

@keyframes drop-fall {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, 150px);
        opacity: 0;
    }
}

.drop-counter {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}
.ftl-drop-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    display: none;
}

.ftl-chemical-drop {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    z-index: 50;
    pointer-events: none;
}
.ftl-drop-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: none;
}

.ftl-chemical-drop {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    z-index: 50;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Add to existing .ftl-workspace rules */
.ftl-workspace {
    position: relative;
    overflow: visible; /* Allow drop animations to extend beyond */
}

.ftl-heating-process {
    background: #fff3e0;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.ftl-heat-progress {
    height: 8px;
    background: #ffb74d;
    width: 0%;
    border-radius: 4px;
    margin-top: 8px;
    transition: width 0.2s ease;
}

.ftl-color-change {
    text-align: center;
    padding: 15px;
}

.ftl-color-box {
    width: 100px;
    height: 60px;
    margin: 0 auto 10px;
    border-radius: 4px;
    transition: background-color 0.5s ease;
}

.ftl-science-note {
    background: #e3f2fd;
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
    font-size: 0.9em;
}

.ftl-result-neutral {
    background: #eceff1;
    padding: 10px;
    border-radius: 4px;
}
.ftl-mixing-process, .ftl-heating-process {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
}

.ftl-mix-progress, .ftl-heat-progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.ftl-bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 15;
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-80px) scale(0.3);
        opacity: 0;
    }
}

.ftl-bubble {
    animation: bubble-rise 1s ease-in forwards,
               bubble-wobble 1s ease-in-out infinite;
}

@keyframes bubble-wobble {
    0%, 100% { transform: translateX(var(--random-offset)); }
    50% { transform: translateX(calc(-1 * var(--random-offset))); }
}

.ftl-heat-indicator {
    animation: pulse 1.5s infinite alternate;
}
@keyframes pulse {
    from { opacity: 0.7; transform: translateX(-50%) scale(1); }
    to { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

const chemicalColors = {
    iodine: '#D2B48C', // Changed from purple to brownish-yellow
    benedicts: '#ff7043'
};

.ftl-lipid-visual {
  width: 100%;
  height: 120px;
  position: relative;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  margin: 15px 0;
}

.ftl-liquid-layer, 
.ftl-lipid-layer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: bold;
}

.ftl-liquid-layer {
  height: 70%;
  background: #e3f2fd;
}

.ftl-lipid-layer {
  height: 30%;
  border-top: 2px solid #c0392b;
}
