/* Custom CSS for Chemistry Virtual Lab */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --purple-color: #6f42c1;
    --light-bg: #f8f9fa;
    --dark-text: #212529;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4c63d2 100%) !important;
}

/* Navigation Styles */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(248, 249, 250, 0.95) !important;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-bottom: none;
    font-weight: 600;
}

/* Custom header colors */
.bg-purple {
    background: linear-gradient(135deg, var(--purple-color) 0%, #8e44ad 100%) !important;
}

/* Formula Box */
.formula-box {
    border-left: 4px solid var(--info-color);
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%) !important;
}

/* Virtual Beaker Styles */
.virtual-beaker {
    width: 200px;
    height: 250px;
    background: linear-gradient(to bottom, rgba(173, 216, 230, 0.3) 0%, rgba(173, 216, 230, 0.8) 100%);
    border: 3px solid #4682b4;
    border-radius: 0 0 50px 50px;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(70, 130, 180, 0.3);
}

.reaction-content {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* Magnesium Strip */
.mg-strip {
    width: 4px;
    height: 80px;
    background: linear-gradient(to bottom, #c0c0c0 0%, #a0a0a0 100%);
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: dissolve 0s ease-out;
}

/* Zinc Granules */
.zn-granules {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.zn-granules::before,
.zn-granules::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #71797E;
    border-radius: 50%;
    bottom: 0;
}

.zn-granules::before {
    left: -10px;
}

.zn-granules::after {
    right: -10px;
}

/* Bubble Animation */
.bubbles {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

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

@keyframes bubble-rise {
    0% {
        bottom: 20px;
        opacity: 0;
        transform: translateX(0) scale(0.3);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        bottom: 200px;
        opacity: 0;
        transform: translateX(20px) scale(1);
    }
}

@keyframes dissolve {
    0% { height: 80px; opacity: 1; }
    100% { height: 20px; opacity: 0.3; }
}

/* Lab Beaker Styles */
.lab-beaker {
    width: 300px;
    height: 350px;
    background: linear-gradient(to bottom, rgba(173, 216, 230, 0.2) 0%, rgba(173, 216, 230, 0.6) 100%);
    border: 4px solid #4682b4;
    border-radius: 0 0 80px 80px;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 0 30px rgba(70, 130, 180, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.2);
}

.lab-solution {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, 
        rgba(255, 255, 0, 0.3) 0%, 
        rgba(255, 255, 0, 0.1) 100%);
    transition: all 0.5s ease;
}

.lab-particles {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 40px;
}

.particle {
    position: absolute;
    background: #71797E;
    border-radius: 50%;
    animation: particle-dissolve 3s ease-out;
}

.particle.large { width: 12px; height: 12px; }
.particle.medium { width: 8px; height: 8px; }
.particle.small { width: 4px; height: 4px; }

@keyframes particle-dissolve {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.8); }
    100% { opacity: 0.3; transform: scale(0.5); }
}

.lab-bubbles {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Gas Meter */
.gas-meter {
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.gas-level {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, #4caf50 0%, #81c784 100%);
    transition: height 0.5s ease;
    height: 0%;
}

/* Molecular Container */
.molecular-container {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    margin: 20px 0;
}

.molecules {
    position: absolute;
    width: 100%;
    height: 100%;
}

.molecule {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    transition: all 0.1s ease;
}

.molecule.type-a {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #ff5252);
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.molecule.type-b {
    background: radial-gradient(circle at 30% 30%, #4ecdc4, #26a69a);
    box-shadow: 0 0 10px rgba(78, 205, 196, 0.5);
}

.molecule.colliding {
    animation: collision-flash 0.3s ease;
}

@keyframes collision-flash {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }
}

.temperature-indicator {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.5s ease;
}

/* Result Areas */
.results-area, .conclusion-area {
    min-height: 60px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--info-color);
}

/* Stats */
.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Quiz Styles */
.quiz-question {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 20px;
}

.form-check {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.form-check:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

.form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

/* Button Animations */
.btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Experiment Container */
.experiment-container {
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Virtual Lab Styles */
.virtual-lab {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    margin: 20px 0;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .virtual-beaker,
    .lab-beaker {
        width: 100%;
        max-width: 250px;
    }
    
    .molecular-container {
        height: 200px;
    }
    
    .experiment-container {
        margin-bottom: 30px;
    }
    
    .card {
        margin-bottom: 20px;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states for accessibility */
.btn:focus,
.form-check-input:focus,
.form-range:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    body {
        background: white !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    
    .btn,
    .navbar,
    footer {
        display: none !important;
    }
}