/* Enable scrolling for this page */
body.awareness-lab-page {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
}

body.awareness-lab-page #app {
    height: auto;
    min-height: 100vh;
}

/* Awareness Lab Styles */
:root {
    --lab-primary: #6B5B95;
    --lab-secondary: #88B04B;
    --lab-accent: #F7CAC9;
    --lab-dark: #1a1a2e;
    --lab-light: #f8f9fa;
    --lab-grounded: #8B7355;
    --lab-fluid: #5B9BD5;
    --lab-radiant: #FFB347;
    --lab-clear: #87CEEB;
    --lab-silent: #9B8AA3;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2rem;
    margin: 10px 0;
    background: linear-gradient(90deg, var(--lab-primary), var(--lab-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-style: italic;
}

.back-btn {
    position: absolute;
    left: 20px;
    top: 20px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Reflection Index */
.reflection-index {
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
}

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

.index-header h2 {
    font-size: 1.3rem;
    color: var(--lab-accent);
}

.state-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    background: var(--lab-primary);
    color: var(--text-primary);
}

.state-badge.resonant { background: var(--lab-secondary); }
.state-badge.coherent { background: #4ECDC4; }
.state-badge.balanced { background: var(--lab-primary); }
.state-badge.transitioning { background: var(--lab-radiant); }
.state-badge.grounding { background: var(--lab-grounded); }

/* Metrics Mandala */
.metrics-mandala {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#mandala-canvas {
    max-width: 100%;
    height: auto;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.metric-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
}

.metric-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 10px;
}

.metric-bar {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lab-primary), var(--lab-secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--lab-secondary);
}

.reflective-sentence {
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
    margin-top: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border-left: 3px solid var(--lab-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESONANCE MIRROR
   ═══════════════════════════════════════════════════════════════════════════════ */

.resonance-mirror {
    background: rgba(255,255,255,0.03);
    border-radius: 20px;
    padding: 30px 25px;
    margin-bottom: 30px;
    text-align: center;
    border: 1px solid rgba(107,91,149,0.15);
}

.resonance-mirror h2 {
    font-size: 1.3rem;
    color: var(--lab-accent);
    margin-bottom: 6px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.mirror-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 25px;
}

.mirror-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    max-width: 300px;
}

#mirror-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Ring stroke transitions */
.mirror-ring {
    transition: stroke-dasharray 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: 160px 160px;
}

/* Mirror Pulse animation - gentle breathing */
@keyframes mirrorPulse {
    0%   { transform: scale(1);    opacity: 1; }
    50%  { transform: scale(1.012); opacity: 0.88; }
    100% { transform: scale(1);    opacity: 1; }
}

.mirror-ring {
    animation: mirrorPulse 2.8s ease-in-out infinite;
}

/* Stagger each ring slightly for an organic feel */
#mirror-ring-pd { animation-delay: 0s; }
#mirror-ring-hq { animation-delay: 0.15s; }
#mirror-ring-sr { animation-delay: 0.3s; }
#mirror-ring-hd { animation-delay: 0.45s; }
#mirror-ring-cf { animation-delay: 0.6s; }

/* Center glow pulses too */
@keyframes centerGlow {
    0%   { opacity: 0.35; }
    50%  { opacity: 0.55; }
    100% { opacity: 0.35; }
}

.mirror-center-glow {
    animation: centerGlow 2.8s ease-in-out infinite;
}

/* Legend */
.mirror-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* Responsive */
@media (max-width: 600px) {
    .mirror-container {
        max-width: 240px;
    }
    .mirror-legend {
        gap: 10px;
    }
}

/* Recommendation Section */
.recommendation-section {
    margin-bottom: 30px;
}

.recommendation-section h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.recommendation-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(107,91,149,0.3), rgba(136,176,75,0.2));
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.rec-icon {
    font-size: 2rem;
}

.rec-content {
    flex: 1;
}

.rec-content h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.rec-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.start-rec-btn {
    background: var(--lab-secondary);
    color: var(--text-primary);
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.start-rec-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(136,176,75,0.4);
}

/* Experiments Section */
.experiments-section {
    margin-bottom: 30px;
}

.experiments-section h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

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

.experiment-card {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.experiment-card:hover {
    transform: translateY(-5px);
    border-color: var(--lab-primary);
    box-shadow: 0 10px 30px rgba(107,91,149,0.3);
}

.experiment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.experiment-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255,255,255,0.1);
}

.experiment-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.experiment-objective {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.5;
}

.experiment-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.experiment-companion {
    color: var(--lab-accent);
}

.experiment-duration {
    color: var(--lab-secondary);
}

/* Experiment Modal */
.experiment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.1);
}

.modal-header {
    padding: 25px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--lab-accent);
}

.modal-companion {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-body {
    padding: 25px;
}

.modal-objective {
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 25px;
    text-align: center;
}

.procedure-steps {
    margin-bottom: 25px;
}

.step-item {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.step-item.active {
    background: rgba(107,91,149,0.2);
    border-left: 3px solid var(--lab-primary);
}

.step-item.completed {
    opacity: 0.6;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--lab-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
}

.step-text {
    flex: 1;
    line-height: 1.5;
}

.timer-display {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    margin-bottom: 20px;
}

.timer-value {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--lab-secondary);
    display: block;
}

.timer-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.reflection-input {
    margin-top: 20px;
}

.reflection-input label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.reflection-input textarea {
    width: 100%;
    height: 100px;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    font-size: 0.95rem;
    resize: none;
}

.reflection-input textarea::placeholder {
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.cancel-btn, .complete-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.cancel-btn:hover {
    background: rgba(255,255,255,0.2);
}

.complete-btn {
    background: var(--lab-secondary);
    color: var(--text-primary);
}

.complete-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(136,176,75,0.4);
}

/* Stats Section */
.stats-section {
    margin-bottom: 30px;
}

.stats-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--lab-secondary);
    display: block;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Notes Section */
.notes-section {
    margin-bottom: 30px;
}

.notes-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-item {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 15px;
    border-left: 3px solid var(--lab-accent);
}

.note-content {
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.empty-message {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
}

/* Responsive */
@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recommendation-card {
        flex-direction: column;
        text-align: center;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
