/* Science Lab Game Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e8f4fd 0%, #d1ecf1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 1400px;
    width: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.game-area {
    padding: 30px;
}

.stats-panel {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.stat-label {
    color: #666;
}

.stat-value {
    color: #333;
    font-weight: 700;
}

/* Experiment Selection */
.experiment-selection {
    margin-bottom: 30px;
}

.experiment-selection h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1.5rem;
}

.experiment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.experiment-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.experiment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.experiment-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.experiment-card h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.experiment-card p {
    opacity: 0.9;
    line-height: 1.4;
}

/* Lab Workspace */
.lab-workspace {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
}

.lab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.lab-header h3 {
    color: #2c3e50;
    font-size: 1.5rem;
}

.experiment-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.lab-btn {
    padding: 8px 16px;
    border: 2px solid #6c757d;
    background: white;
    color: #6c757d;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lab-btn:hover {
    background: #6c757d;
    color: white;
}

.lab-area {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 20px;
    min-height: 500px;
}

/* Tools Panel */
.tools-panel {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tools-panel h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-item:hover {
    background: #e9ecef;
}

.tool-item.selected {
    background: #007bff;
    color: white;
}

.tool-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.tool-label {
    flex: 1;
    font-weight: 500;
}

/* Experiment Canvas */
.experiment-canvas {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Pendulum Experiment */
.pendulum-setup {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: linear-gradient(180deg, #e8f4fd 0%, #d1ecf1 50%, #f8f9fa 100%);
}

.pendulum-pivot {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #333;
    border-radius: 50%;
}

.pendulum-string {
    position: absolute;
    top: 55px;
    left: 50%;
    transform-origin: top;
    width: 2px;
    height: 200px;
    background: #666;
}

.pendulum-bob {
    position: absolute;
    bottom: 0;
    left: -15px;
    width: 30px;
    height: 30px;
    background: #e74c3c;
    border-radius: 50%;
    cursor: pointer;
}

/* Circuit Experiment */
.circuit-board {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: #f4e4bc;
    border: 2px solid #8b4513;
}

.circuit-component {
    position: absolute;
    cursor: pointer;
    transition: all 0.3s ease;
}

.circuit-component:hover {
    transform: scale(1.1);
}

.battery {
    width: 40px;
    height: 20px;
    background: #333;
    border-radius: 3px;
}

.resistor {
    width: 30px;
    height: 10px;
    background: #8b4513;
    border-radius: 2px;
}

.bulb {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50%;
}

.bulb.lit {
    background: #ffd700;
    box-shadow: 0 0 20px #ffd700;
}

.wire {
    position: absolute;
    height: 3px;
    background: #c0c0c0;
    border-radius: 2px;
}

/* Color Mixing Experiment */
.color-mixing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    gap: 20px;
}

.color-containers {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.color-container {
    width: 100px;
    height: 120px;
    border: 2px solid #333;
    border-radius: 8px;
    background: white;
    position: relative;
    overflow: hidden;
}

.color-liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    transition: all 0.5s ease;
}

.mixing-result {
    width: 150px;
    height: 120px;
    border: 2px solid #333;
    border-radius: 8px;
    background: white;
}

/* Plant Growth Experiment */
.plant-experiment {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: linear-gradient(180deg, #87ceeb 0%, #98fb98 100%);
}

.plant-pot {
    position: absolute;
    bottom: 50px;
    width: 80px;
    height: 60px;
    background: #8b4513;
    border-radius: 5px 5px 0 0;
}

.plant {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background: #228b22;
    transition: all 0.5s ease;
}

.plant.growing {
    height: 150px;
}

/* Results Panel */
.results-panel {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.results-panel h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.observations, .measurements {
    margin-bottom: 15px;
}

.observation-item, .measurement-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.measurement-item {
    display: flex;
    justify-content: space-between;
}

.measurement-label {
    font-weight: 500;
}

.measurement-value {
    color: #007bff;
    font-weight: 600;
}

.message {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    min-height: 2rem;
    margin: 20px 0;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.message.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message.hint {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.game-controls {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.primary-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.secondary-btn {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e0e0e0;
}

.secondary-btn:hover {
    background: #e9ecef;
    border-color: #dee2e6;
}

.results {
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.results h2 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.final-stat {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.final-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: 5px;
}

.final-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.grade {
    font-size: 2rem !important;
}

.grade.A { color: #28a745; }
.grade.B { color: #17a2b8; }
.grade.C { color: #ffc107; }
.grade.D { color: #fd7e14; }
.grade.F { color: #dc3545; }

/* Responsive Design */
@media (max-width: 1024px) {
    .lab-area {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .tools-panel, .results-panel {
        order: 1;
    }

    .experiment-canvas {
        order: 2;
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .game-area {
        padding: 20px;
    }

    .stats-panel {
        flex-direction: column;
        gap: 10px;
    }

    .experiment-grid {
        grid-template-columns: 1fr;
    }

    .lab-header {
        flex-direction: column;
        align-items: stretch;
    }

    .experiment-controls {
        justify-content: center;
    }

    .final-stats {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.experiment-card, .tool-item {
    animation: fadeIn 0.5s ease-out;
}

.correct-animation {
    animation: correctPulse 0.6s ease-out;
}

.incorrect-animation {
    animation: incorrectShake 0.6s ease-out;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}