* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.simulation-area {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.apparatus {
    flex: 2;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    min-height: 400px;
}

.mug {
    position: relative;
    width: 300px;
    height: 250px;
    margin: 0 auto;
    background: linear-gradient(to bottom, #e8f4f8 0%, #d1ecf1 100%);
    border: 3px solid #2c3e50;
    border-radius: 10px 10px 20px 20px;
    overflow: hidden;
}

.water {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80%;
    background: linear-gradient(to bottom, #3498db 0%, #2980b9 100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.electrode {
    position: absolute;
    width: 8px;
    height: 120px;
    background: #34495e;
    border-radius: 4px;
    bottom: 20px;
}

.cathode {
    left: 80px;
}

.anode {
    right: 80px;
}

.electrode-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: bold;
    color: #2c3e50;
    white-space: nowrap;
}

.test-tube {
    position: absolute;
    width: 40px;
    height: 100px;
    background: linear-gradient(to bottom, transparent 0%, #ecf0f1 100%);
    border: 2px solid #bdc3c7;
    border-radius: 0 0 20px 20px;
    top: -20px;
}

.left-tube {
    left: 65px;
}

.right-tube {
    right: 65px;
}

.tube-label {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: #2c3e50;
    white-space: nowrap;
}

.gas-collection {
    position: absolute;
    bottom: 0;
    left: 2px;
    right: 2px;
    height: 0%;
    border-radius: 0 0 18px 18px;
    transition: height 0.5s ease;
}

.hydrogen {
    background: linear-gradient(to top, #f39c12 0%, #f1c40f 100%);
}

.oxygen {
    background: linear-gradient(to top, #e74c3c 0%, #c0392b 100%);
}

.bubbles-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    animation: bubble-rise 2s linear infinite;
}

@keyframes bubble-rise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-150px) scale(1.5);
    }
}

.battery {
    position: absolute;
    top: -80px;
    right: -100px;
}

.battery-body {
    width: 80px;
    height: 40px;
    background: linear-gradient(to bottom, #2c3e50 0%, #34495e 100%);
    border-radius: 5px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-around;
    color: white;
    font-weight: bold;
}

.battery-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #2c3e50;
    white-space: nowrap;
}

.wire {
    position: absolute;
    height: 3px;
    background: #e74c3c;
}

.wire-positive {
    width: 120px;
    top: 10px;
    right: 0;
    transform: rotate(-30deg);
    transform-origin: right center;
}

.wire-negative {
    width: 140px;
    top: 30px;
    right: 0;
    background: #2c3e50;
    transform: rotate(-45deg);
    transform-origin: right center;
}

.control-panel {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    height: fit-content;
}

.control-btn {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.start-btn {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
}

.start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.stop-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
}

.stop-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.reset-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    color: white;
}

.reset-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.test-btn {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    color: white;
}

.test-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-panel {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.status-item label {
    font-weight: bold;
    color: #2c3e50;
}

.info-panel, .results-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.info-panel h3, .results-panel h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.info-content p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.info-content ul {
    margin-left: 20px;
    line-height: 1.6;
}

.info-content ul li {
    margin-bottom: 5px;
}

.running .water {
    animation: water-electrolysis 2s ease-in-out infinite alternate;
}

@keyframes water-electrolysis {
    0% { opacity: 0.7; }
    100% { opacity: 0.9; }
}

.test-result {
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    border-left: 4px solid;
}

.test-result.hydrogen {
    background: #fff3cd;
    border-color: #f39c12;
}

.test-result.oxygen {
    background: #f8d7da;
    border-color: #e74c3c;
}

@media (max-width: 768px) {
    .simulation-area {
        flex-direction: column;
    }
    
    .apparatus {
        order: 2;
    }
    
    .control-panel {
        order: 1;
    }
    
    .mug {
        width: 250px;
        height: 200px;
    }
    
    .battery {
        right: -50px;
        top: -60px;
    }
}

