/* Science Lab Discovery Platform - Comprehensive Styling */

/* ⚡ SKIP LINK - Accessible Navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #ff6b6b;
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    z-index: 1000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

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

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #2d3748;
    overflow-x: hidden;
    position: relative;
}

/* Particles Background Animation */
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 50%);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out;
}

@keyframes float {
    0%, 100% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Screen Management */
.screen {
    /* CRITICAL FIX: Hide inactive screens completely */
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    /* CRITICAL FIX: Show active screen in layout */
    display: block;
}

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

/* Profile Screen Styling */
#profile-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-align: center;
}

.lab-header {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.lab-header h1 {
    font-size: 2.5rem;
    color: #4a5568;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 800px;
}

.profile-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.profile-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.new-profile-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

.scientist-avatar-selection {
    margin: 1.5rem 0;
}

.avatar-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 1rem;
}

.avatar-btn {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    border: 3px solid transparent;
    border-radius: 15px;
    padding: 1rem;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.avatar-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.avatar-btn.selected {
    border-color: #4299e1;
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    color: white;
}

/* Dashboard Styling */
#lab-dashboard {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
    padding: 2rem;
}

.lab-nav-header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.scientist-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.scientist-info #scientist-avatar {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scientist-details h2 {
    font-size: 2rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.lab-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.lab-stats span {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    color: #2d3748;
}

.lab-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.robot-btn, .journal-btn {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #2d3748;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.robot-btn:hover, .journal-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

/* Lab Sections */
.lab-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.lab-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.section-header h3 {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 1rem;
    text-align: center;
}

.section-header p {
    text-align: center;
    color: #4a5568;
    margin-bottom: 1.5rem;
}

.lab-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.lab-option-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.lab-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.lab-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.lab-desc {
    font-size: 0.9rem;
    opacity: 0.9;
}

.feature-btn {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #2d3748;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    width: calc(100% - 1rem);
}

.feature-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* Virtual Laboratory Interface */
.lab-interface {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.lab-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #e2e8f0;
}

.lab-controls-bar {
    display: flex;
    gap: 1rem;
}

.safety-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
}

.safety-btn.active {
    box-shadow: 0 0 20px rgba(72, 187, 120, 0.5);
    transform: scale(1.1);
}

.emergency-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
}

.emergency-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(245, 101, 101, 0.3);
}

/* Chemistry Lab Interface */
.lab-workspace {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    min-height: 400px;
}

.equipment-area {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 1.5rem;
    border-radius: 15px;
}

.equipment-shelf {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.equipment-item {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
}

.equipment-item:hover {
    border-color: #4299e1;
    transform: scale(1.05);
}

.equipment-item.selected {
    border-color: #3182ce;
    background: #bee3f8;
}

.experiment-area {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border: 3px dashed #cbd5e0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.work-surface {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container-slot {
    width: 200px;
    height: 200px;
    border: 3px dashed #a0aec0;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.container-slot.has-container {
    border-color: #4299e1;
    background: rgba(66, 153, 225, 0.1);
}

.container-placeholder {
    color: #a0aec0;
    font-size: 1.1rem;
    text-align: center;
}

.virtual-container {
    width: 80%;
    height: 80%;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #4a5568;
}

.liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: all 0.5s ease;
    border-radius: 0 0 8px 8px;
}

.materials-area {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    padding: 1.5rem;
    border-radius: 15px;
}

.materials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.material-btn {
    background: white;
    border: 2px solid #48bb78;
    padding: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.material-btn:hover {
    background: #f0fff4;
    transform: translateX(5px);
}

/* Physics Lab Interface */
.physics-workspace {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.simulation-area {
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

#physics-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.physics-controls {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    padding: 2rem;
    border-radius: 15px;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d3748;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

.physics-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    margin: 0.5rem 0;
    width: 100%;
    transition: all 0.3s ease;
}

.physics-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(237, 137, 54, 0.3);
}

/* Biology Lab Interface */
.biology-workspace {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.microscope-area {
    background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
    padding: 2rem;
    border-radius: 15px;
}

.microscope {
    background: #2d3748;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.specimen-viewer {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 50%;
    border: 10px solid #4a5568;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.microscope-field {
    color: #48bb78;
    font-family: monospace;
    text-align: center;
    font-size: 1.2rem;
}

.microscope-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.mag-btn {
    background: #4a5568;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mag-btn.active {
    background: #48bb78;
}

.specimens-area {
    background: linear-gradient(135deg, #f0f4f8 0%, #d6f5d6 100%);
    padding: 2rem;
    border-radius: 15px;
}

.specimens-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.specimen-btn {
    background: white;
    border: 2px solid #48bb78;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.specimen-btn:hover {
    background: #f0fff4;
    transform: scale(1.05);
}

/* Earth Science Interface */
.earth-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.weather-station {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    padding: 2rem;
    border-radius: 15px;
}

.weather-controls {
    margin-bottom: 2rem;
}

.weather-param {
    margin-bottom: 1rem;
}

.weather-param label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.weather-param input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

.weather-visualization {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
}

.weather-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.weather-description {
    font-size: 1.2rem;
    color: #2d3748;
}

.geological-area {
    background: linear-gradient(135deg, #fed7aa 0%, #fbb6ce 100%);
    padding: 2rem;
    border-radius: 15px;
}

.rock-layers {
    height: 200px;
    position: relative;
    background: #8b4513;
    border-radius: 10px;
    overflow: hidden;
}

.rock-layer {
    position: absolute;
    left: 0;
    right: 0;
    height: 33.33%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.rock-layer[data-age="recent"] {
    top: 0;
    background: #a0522d;
}

.rock-layer[data-age="old"] {
    top: 33.33%;
    background: #8b7355;
}

.rock-layer[data-age="ancient"] {
    top: 66.66%;
    background: #2f4f4f;
}

.rock-layer:hover {
    transform: scale(1.02);
    z-index: 10;
}

/* Scientific Method Steps */
.scientific-method-steps {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.method-step {
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-left: 5px solid #cbd5e0;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.method-step.active {
    opacity: 1;
    border-left-color: #4299e1;
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    transform: scale(1.02);
}

.step-number {
    background: #4299e1;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.method-step h3 {
    color: #2d3748;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.method-step textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: all 0.3s ease;
}

.method-step textarea:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    outline: none;
}

.robot-suggestions {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
    margin-top: 1rem;
}

.robot-avatar {
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
}

.robot-message {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 10px;
    color: #2d3748;
    flex-grow: 1;
}

.experiment-design {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.design-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d3748;
}

/* Data Analysis Styling */
.analysis-workspace {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.chart-area {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.analysis-controls {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.control-panel {
    background: linear-gradient(135deg, #f0f4f8 0%, #d6f5d6 100%);
    padding: 1.5rem;
    border-radius: 15px;
}

.control-panel h4 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.chart-btn {
    display: block;
    width: 100%;
    background: white;
    border: 2px solid #e2e8f0;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    text-align: left;
}

.chart-btn:hover {
    border-color: #4299e1;
}

.chart-btn.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

.data-input {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    padding: 1.5rem;
    border-radius: 15px;
}

.data-entry {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.data-entry input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.data-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.data-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.3);
}

.data-btn.secondary {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.data-list {
    max-height: 150px;
    overflow-y: auto;
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.data-item:last-child {
    border-bottom: none;
}

.remove-data-btn {
    background: #f56565;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.pattern-detection {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.pattern-results {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
}

.robot-analysis {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

/* Discovery Journal Styling */
.journal-workspace {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    min-height: 600px;
}

.journal-sidebar {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 1.5rem;
    border-radius: 15px;
}

.journal-stats {
    margin-bottom: 2rem;
}

.stat {
    display: block;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d3748;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.journal-filters h4 {
    margin-bottom: 1rem;
    color: #2d3748;
}

.filter-btn {
    display: block;
    width: 100%;
    background: white;
    border: 2px solid #e2e8f0;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    text-align: left;
}

.filter-btn:hover {
    border-color: #4299e1;
}

.filter-btn.active {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

.journal-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    overflow-y: auto;
}

.journal-entries {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.journal-entry {
    padding: 1.5rem;
    border-radius: 15px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-left: 5px solid #4299e1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.journal-entry:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.entry-date {
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.entry-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 1rem;
}

.entry-content {
    color: #4a5568;
    line-height: 1.6;
}

.welcome-entry {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    border-left-color: #ed8936;
}

/* Research Robot Styling */
.robot-workspace {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.robot-display {
    background: linear-gradient(135deg, #e6fffa 0%, #b2f5ea 100%);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
}

.robot-avatar-large {
    margin-bottom: 2rem;
}

.robot-face {
    font-size: 6rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 50%;
    display: inline-block;
    margin-bottom: 1rem;
    animation: robotPulse 2s infinite ease-in-out;
}

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

.robot-status {
    font-size: 1.2rem;
    color: #2d3748;
    font-weight: bold;
}

.abilities-list {
    text-align: left;
}

.ability {
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ability.unlocked {
    color: #38a169;
    border-left: 4px solid #38a169;
}

.ability.locked {
    color: #a0aec0;
    border-left: 4px solid #e2e8f0;
    opacity: 0.6;
}

.robot-interaction {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 2rem;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
}

.chat-area {
    flex-grow: 1;
    margin-bottom: 2rem;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border-radius: 10px;
    padding: 1rem;
}

.robot-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.robot-avatar-small {
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.5rem;
    border-radius: 50%;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-content {
    background: #f7fafc;
    padding: 1rem;
    border-radius: 10px;
    flex-grow: 1;
    color: #2d3748;
    line-height: 1.5;
}

.chat-input-area {
    display: flex;
    gap: 1rem;
}

.chat-input-area input {
    flex-grow: 1;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
}

.robot-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.robot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Experiment Designer Styling */
.designer-workspace {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.design-steps {
    background: linear-gradient(135deg, #f0f4f8 0%, #d6f5d6 100%);
    padding: 2rem;
    border-radius: 15px;
}

.design-step {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.design-step.active {
    opacity: 1;
    transform: scale(1.02);
    border-left: 4px solid #4299e1;
}

.design-step h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.focus-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.focus-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.9rem;
}

.focus-btn:hover {
    border-color: #4299e1;
    transform: scale(1.02);
}

.focus-btn.selected {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
}

.variables-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.variable-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2d3748;
}

.variable-group input, .variable-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
}

.procedure-builder {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.procedure-step-template {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.step-number {
    background: #4299e1;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

.step-text {
    flex-grow: 1;
    padding: 0.8rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}

.remove-step-btn {
    background: #f56565;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.designer-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.designer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.3);
}

.experiment-preview {
    background: linear-gradient(135deg, #fef5e7 0%, #fed7aa 100%);
    padding: 2rem;
    border-radius: 15px;
}

.preview-content {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    min-height: 400px;
    color: #2d3748;
    line-height: 1.6;
}

/* Secret Laboratory Styling */
.secret-workspace {
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    margin: 2rem 0;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.advanced-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.tool-section {
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tool-section h3 {
    color: #48bb78;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.advanced-tool canvas {
    background: #000;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: 2px solid #4299e1;
}

.tool-controls {
    margin-top: 1rem;
}

.tool-controls label {
    display: block;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

.tool-controls input[type="range"] {
    width: 100%;
}

.dna-sequence {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.base-pair {
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-family: monospace;
    font-weight: bold;
    color: white;
    animation: dnaGlow 2s infinite ease-in-out;
}

@keyframes dnaGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(66, 153, 225, 0.3); }
    50% { box-shadow: 0 0 20px rgba(66, 153, 225, 0.6); }
}

.particle-chamber canvas {
    border: 2px solid #48bb78;
    border-radius: 15px;
}

.secret-btn {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(159, 122, 234, 0.3);
}

.secret-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(159, 122, 234, 0.5);
}

.historical-scientists {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 15px;
    margin-top: 2rem;
}

.scientist-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.scientist-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.scientist-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.scientist-portrait {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.scientist-card h4 {
    color: #48bb78;
    margin-bottom: 0.5rem;
}

.scientist-card p {
    color: #e2e8f0;
    font-size: 0.9rem;
}

/* Button Styling */
.lab-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.lab-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.lab-btn.primary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.lab-btn.secondary {
    background: linear-gradient(135deg, #a0aec0 0%, #718096 100%);
}

.lab-btn.hidden {
    opacity: 0;
    pointer-events: none;
}

.step-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
}

.step-btn:disabled {
    background: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.step-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Input Styling */
input[type="text"], input[type="number"], textarea, select {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    outline: none;
}

input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
    width: 100%;
}

input[type="range"]::-webkit-slider-track {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
}

/* Footer Styling */
.dashboard-footer, .lab-footer, .hypothesis-footer, .analysis-footer, 
.journal-footer, .robot-footer, .designer-footer, .secret-footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .lab-sections {
        grid-template-columns: 1fr;
    }
    
    .lab-workspace {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .analysis-workspace, .journal-workspace, .robot-workspace, .designer-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .lab-nav-header {
        flex-direction: column;
        text-align: center;
    }
    
    .scientist-info {
        flex-direction: column;
        text-align: center;
    }
    
    .lab-stats {
        justify-content: center;
    }
    
    .lab-options {
        grid-template-columns: 1fr;
    }
    
    .physics-workspace, .biology-workspace, .earth-workspace {
        grid-template-columns: 1fr;
    }
    
    .avatar-options {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .focus-options {
        grid-template-columns: 1fr;
    }
    
    .experiment-design {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }
    
    .screen {
        padding: 1rem;
    }
    
    .lab-header h1 {
        font-size: 2rem;
    }
    
    .scientist-details h2 {
        font-size: 1.5rem;
    }
    
    .lab-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .avatar-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .advanced-tools {
        grid-template-columns: 1fr;
    }
    
    .scientist-cards {
        grid-template-columns: 1fr;
    }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .robot-face {
        animation: none;
    }
    
    .base-pair {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    body {
        background: #000;
        color: #fff;
    }
    
    .screen {
        background: #000;
    }
    
    .lab-btn {
        border: 2px solid #fff;
    }
    
    .lab-section, .method-step, .journal-entry {
        border: 2px solid #fff;
        background: #333;
    }
}

/* Print Styles */
@media print {
    .screen {
        display: block !important;
    }
    
    .lab-btn, button {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .particles-background {
        display: none;
    }
}

/* 🔧 CRITICAL VIEWPORT POSITIONING FIXES */
/* These fixes ensure content always appears at the top of the viewport when screens change */
html, body {
    margin: 0 !important;
    padding-top: 20px !important;
    padding-bottom: 0 !important;
}

.screen.active {
    position: relative !important;
    top: 0 !important;
    margin-top: 0 !important;
    align-self: flex-start !important;
    justify-self: center !important;
}

/* Fix for screens appearing below the viewport */
.screen {
    position: relative !important;
    top: 0 !important;
}

/* Additional viewport safety overrides */
#app {
    position: relative !important;
    top: 0 !important;
}

/* Force container positioning to prevent layout drift */
.lab-header, .lab-section {
    position: relative !important;
    top: 0 !important;
    margin-top: 0 !important;
}