/* Virtual Lab Shared Styles - Dark Theme */

/* --- Base Styles --- */
body {
    background-color: #0A1929;
    color: #F8FAFC;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    overflow-y: auto;
}

/* --- Utilities --- */
.glass-panel {
    background: rgba(19, 47, 76, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-panel-heavy {
    background: rgba(10, 25, 41, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0A1929;
}

::-webkit-scrollbar-thumb {
    background: #1E4976;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2A5A8D;
}

/* --- Common Animations --- */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* --- Lab Specific Helpers --- */
.lab-notebook-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem; /* text-xs */
}

/* --- Phase 1 Learning Guide --- */
.phase1-learning-guide {
    width: 100%;
    padding: 16px;
}

.phase1-guide-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(19, 47, 76, 0.62);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.phase1-guide-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.85fr);
    gap: 16px;
    align-items: start;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.phase1-kicker {
    margin: 0 0 6px;
    color: #4CC9F0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.phase1-guide-header h2 {
    margin: 0;
    color: #F8FAFC;
    font-size: clamp(1.15rem, 1rem + 0.7vw, 1.7rem);
    line-height: 1.2;
    letter-spacing: 0;
}

.phase1-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.phase1-meta div {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(10, 25, 41, 0.58);
}

.phase1-meta dt {
    color: #94A3B8;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.phase1-meta dd {
    margin: 3px 0 0;
    color: #F8FAFC;
    font-size: 0.82rem;
    line-height: 1.35;
}

.phase1-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.phase1-card {
    min-height: 118px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(10, 25, 41, 0.44);
}

.phase1-card h3 {
    margin: 0 0 7px;
    color: #F59E0B;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.phase1-card p {
    margin: 0;
    color: #CBD5E1;
    font-size: 0.82rem;
    line-height: 1.45;
}

.phase1-learning-loop {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
    gap: 10px 14px;
    align-items: stretch;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.phase1-learning-loop label {
    color: #CBD5E1;
    font-size: 0.86rem;
    line-height: 1.45;
}

.phase1-learning-loop label span {
    display: block;
    margin-bottom: 4px;
    color: #4CC9F0;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.phase1-learning-loop textarea {
    width: 100%;
    min-height: 70px;
    resize: vertical;
    padding: 10px;
    border: 1px solid rgba(76, 201, 240, 0.22);
    border-radius: 8px;
    background: rgba(10, 25, 41, 0.76);
    color: #F8FAFC;
    font: 0.86rem/1.45 'Inter', sans-serif;
}

.phase1-learning-loop textarea:focus {
    outline: 2px solid #4CC9F0;
    outline-offset: 2px;
}

@media (max-width: 980px) {
    .phase1-guide-header,
    .phase1-learning-loop {
        grid-template-columns: 1fr;
    }

    .phase1-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .phase1-learning-guide {
        padding: 12px;
    }

    .phase1-guide-inner {
        padding: 14px;
    }

    .phase1-meta,
    .phase1-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Floating Ask AI Button --- */
.ask-ai-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #7C3AED, #DB2777);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(124, 58, 237, 0.4), 0 0 0 0 rgba(124, 58, 237, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    animation: ai-fab-pulse 3s ease-in-out infinite;
}

.ask-ai-fab:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.5), 0 0 20px rgba(219, 39, 119, 0.3);
    animation: none;
}

.ask-ai-fab:active {
    transform: translateY(-1px) scale(1.02);
}

.ask-ai-fab .ai-icon {
    font-size: 20px;
    line-height: 1;
}

.ask-ai-fab .ai-label {
    white-space: nowrap;
}

@keyframes ai-fab-pulse {
    0%, 100% { box-shadow: 0 4px 24px rgba(124, 58, 237, 0.4), 0 0 0 0 rgba(124, 58, 237, 0.3); }
    50% { box-shadow: 0 4px 24px rgba(124, 58, 237, 0.4), 0 0 0 10px rgba(124, 58, 237, 0); }
}

/* Responsive: collapse to icon-only on small screens */
@media (max-width: 640px) {
    .ask-ai-fab {
        padding: 14px;
        border-radius: 50%;
    }
    .ask-ai-fab .ai-label {
        display: none;
    }
}
