#mimoza-sim-root {
    --bg-dark: #050510;
    --bg-panel: #101025;
    --accent-primary: #6c5ce7;
    --accent-secondary: #00cec9;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    --color-red: #ff7675;
    --color-green: #55efc4;
    --font-family: 'Roboto', sans-serif;
    
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Ensure it has a height or adapts to content, but minimum height for effect */
    min-height: 600px;
    border-radius: 20px;
}

#mimoza-sim-root * {
    box-sizing: border-box;
}

/* Galaxy Background Animation - Scoped to the container */
#mimoza-sim-root .background-stars, 
#mimoza-sim-root .background-twinkling {
    position: absolute; /* Changed from fixed to absolute */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

#mimoza-sim-root .background-stars {
    background: #000;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 50px 160px, #ddd, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, #ddd, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    z-index: 0;
    animation: stars-move 100s linear infinite;
}

#mimoza-sim-root .background-twinkling {
    background: transparent;
    background-image: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1), transparent 60%);
    z-index: 1;
    animation: twinkle 5s ease-in-out infinite;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
}

@keyframes stars-move {
    from {background-position:0 0;}
    to {background-position:0 1000px;}
}

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
    100% { opacity: 0.3; transform: scale(1); }
}

#mimoza-sim-root .simulator-wrapper {
    display: flex;
    background: rgba(16, 16, 37, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    height: 600px; /* Fixed height for consistency */
    box-shadow: 0 0 30px rgba(108, 92, 231, 0.2);
    position: relative;
    z-index: 2; /* Above background */
    margin: 20px;
}

/* Chat Panel */
#mimoza-sim-root .chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

#mimoza-sim-root .chat-header {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

#mimoza-sim-root .bot-avatar {
    width: 40px;
    height: 40px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
}

#mimoza-sim-root .bot-info h3 {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-main);
}

#mimoza-sim-root .status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--color-green);
    border-radius: 50%;
    margin-right: 4px;
}

#mimoza-sim-root .bot-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

#mimoza-sim-root .chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#mimoza-sim-root .message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

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

#mimoza-sim-root .message.bot {
    background: rgba(108, 92, 231, 0.2);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(108, 92, 231, 0.3);
}

#mimoza-sim-root .message.user {
    background: var(--accent-primary);
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    color: white;
}

#mimoza-sim-root .input-area {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

#mimoza-sim-root .chat-btn {
    background: transparent;
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

#mimoza-sim-root .chat-btn:hover {
    background: var(--accent-secondary);
    color: var(--bg-dark);
    box-shadow: 0 0 10px var(--accent-secondary);
}

#mimoza-sim-root input[type=email],
#mimoza-sim-root input[type=tel] {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

#mimoza-sim-root input[type=email]::placeholder,
#mimoza-sim-root input[type=tel]::placeholder {
    color: var(--text-muted);
}

/* Dashboard Panel */
#mimoza-sim-root .dashboard-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

#mimoza-sim-root .dashboard-header h2 {
    font-size: 1.2rem;
    color: var(--accent-secondary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#mimoza-sim-root .dashboard-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#mimoza-sim-root .metric-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.5s ease;
}

#mimoza-sim-root .metric-card.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    border: none;
}

#mimoza-sim-root .metric-card h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

#mimoza-sim-root .stat-display {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

#mimoza-sim-root .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

#mimoza-sim-root #wasted-time { color: var(--color-red); }
#mimoza-sim-root #saved-time { color: var(--color-green); }

#mimoza-sim-root .stat-unit {
    color: var(--text-muted);
}

#mimoza-sim-root .stat-money {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-top: 5px;
    font-weight: 500;
}

#mimoza-sim-root .progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
}

#mimoza-sim-root .progress-bar {
    height: 100%;
    width: 0%;
    transition: width 1s ease;
}

#mimoza-sim-root .progress-bar.red { background: var(--color-red); }
#mimoza-sim-root .progress-bar.green { background: var(--color-green); }

/* Visualizer area */
#mimoza-sim-root .chart-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#mimoza-sim-root .vis-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    transition: all 0.5s ease;
}

#mimoza-sim-root .vis-circle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
    opacity: 0.5;
    animation: pulse 3s infinite;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.5; }
}

/* Responsive */
@media (max-width: 768px) {
    #mimoza-sim-root .simulator-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    #mimoza-sim-root .chat-panel {
        height: 400px;
    }
    
    #mimoza-sim-root .dashboard-panel {
        height: auto;
    }
}
