/* Simulator V3 - Premium Redesign */

/* Core Scene Container */
.sim-scene {
    position: relative;
    width: 100%;
    height: 450px;
    /* Increased height */
    background-color: var(--color-bg-dark);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Background Image Layer */
.scene-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

/* Overlay Layers */
.scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.dirt-overlay {
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.5'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    opacity: 0.7;
    transition: opacity 1s ease;
}

.dirt-overlay.cleaned {
    opacity: 0;
}

.tech-grid {
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0;
    transition: opacity 0.5s ease;
    box-shadow: inset 0 0 100px rgba(59, 130, 246, 0.2);
}

/* Sidebar Buttons */
.sim-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sim-nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--color-text-light);
    font-weight: 500;
}

.sim-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.sim-nav-item.active {
    background: linear-gradient(90deg, rgba(244, 180, 0, 0.15), rgba(244, 180, 0, 0.05));
    border-color: var(--color-secondary);
    color: var(--color-secondary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(244, 180, 0, 0.1);
}

.sim-nav-item.active .sim-nav-icon {
    color: var(--color-secondary);
}

.sim-nav-icon {
    font-size: 1.25rem;
    color: #64748B;
    transition: color 0.2s ease;
}


/* Controls Area */
.sim-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-tile {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-tile:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--color-secondary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-tile.completed {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10B981;
    pointer-events: none;
}

.action-icon {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--color-text-light);
    transition: all 0.3s ease;
}

.action-tile:hover .action-icon {
    color: var(--color-secondary);
    background: rgba(244, 180, 0, 0.1);
}

.action-tile.completed .action-icon {
    background: #10B981;
    color: white;
}

.action-content h4 {
    margin: 0 0 0.25rem 0;
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

.action-content p {
    margin: 0;
    color: var(--color-text-light);
    font-size: 0.85rem;
}

/* Gauge Styles */
.gauge-container {
    width: 70px;
    height: 70px;
    position: relative;
    margin-right: 1.5rem;
}

.gauge-svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

.gauge-progress {
    fill: none;
    stroke: var(--color-secondary);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 4px rgba(244, 180, 0, 0.5));
}

.gauge-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
}

/* Action Arrow (Replaces Amount) */
.action-arrow {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    font-size: 1.25rem;
}

.action-tile:hover .action-arrow {
    color: var(--color-secondary);
    transform: rotate(90deg);
}

.action-tile.completed .action-arrow {
    background: #10B981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transform: rotate(0);
}

.action-tile.completed .action-arrow i::before {
    content: "\echeck";
    /* Phosphor Check Icon Code roughly, acts as visually check */
}

/* Savings Popup */
.savings-popup {
    position: fixed;
    z-index: 9999;
    color: #F59E0B;
    background: rgba(10, 25, 47, 0.9);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    animation: popupFloat 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    backdrop-filter: blur(4px);
}

@keyframes popupFloat {
    0% {
        opacity: 0;
        transform: translate(-50%, 0) scale(0.8);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -20px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -100px) scale(1);
    }
}


/* Particles */
.gold-particle {
    position: absolute;
    color: var(--color-secondary);
    font-weight: 800;
    font-size: 1.5rem;
    animation: floatUp 1.5s forwards;
    pointer-events: none;
    z-index: 100;
    text-shadow: 0 0 10px rgba(244, 180, 0, 0.6);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(0.8);
        opacity: 0;
    }

    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1.2);
    }

    100% {
        transform: translateY(-60px) scale(1);
        opacity: 0;
    }
}

/* Background Image Layer */
.scene-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
    /* Base layer */
}

/* Overlay Layers */
.scene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    /* Above bg */
}

.dirt-overlay {
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.5'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    opacity: 0.6;
    transition: opacity 1s ease;
}

.dirt-overlay.cleaned {
    opacity: 0;
}

.tech-grid {
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tech-grid.active {
    opacity: 1;
}

/* Rest of styles (Tiles, Gauges) copied from v2 but cleaned up */
.sim-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-tile {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.action-tile:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(245, 158, 11, 0.5);
    /* Gold hover */
}

.action-tile.completed {
    background: rgba(16, 185, 129, 0.1);
    /* Green tint */
    border-color: #10B981;
    pointer-events: none;
}

.action-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #94A3B8;
}

.action-tile.completed .action-icon {
    background: #10B981;
    color: white;
}

.action-content h4 {
    margin: 0;
    color: white;
    font-size: 0.95rem;
}

.action-content p {
    margin: 0;
    color: #94A3B8;
    font-size: 0.8rem;
}

/* HUD Gauge System */
.gauge-hud {
    width: 90px;
    height: 90px;
    position: relative;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Outer Static Ring */
.gauge-outer-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: spinSlow 30s linear infinite;
}

@keyframes spinSlow {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Tick Marks */
.gauge-ticks {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.tick {
    position: absolute;
    width: 2px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    left: 50%;
    top: 0;
    transform-origin: center 45px;
    /* Half of 90px container */
}

.tick:nth-child(1) {
    transform: translateX(-50%) rotate(0deg);
}

.tick:nth-child(2) {
    transform: translateX(-50%) rotate(45deg);
}

.tick:nth-child(3) {
    transform: translateX(-50%) rotate(90deg);
}

.tick:nth-child(4) {
    transform: translateX(-50%) rotate(135deg);
}

.tick:nth-child(5) {
    transform: translateX(-50%) rotate(180deg);
}

.tick:nth-child(6) {
    transform: translateX(-50%) rotate(225deg);
}

.tick:nth-child(7) {
    transform: translateX(-50%) rotate(270deg);
}

.tick:nth-child(8) {
    transform: translateX(-50%) rotate(315deg);
}

.gauge-svg {
    width: 80%;
    height: 80%;
    transform: rotate(-90deg);
    position: relative;
    z-index: 10;
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 6;
}

.gauge-progress {
    fill: none;
    stroke: url(#gaugeGradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 264;
    /* Circumference of r=42 is ~264 */
    stroke-dashoffset: 264;
    /* Starts empty */
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    z-index: 20;
}

.gauge-center-text .value {
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.gauge-center-text .unit {
    color: var(--color-text-light);
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 2px;
}

/* Particles */
.gold-particle {
    position: absolute;
    color: #F59E0B;
    font-size: 1.5rem;
    animation: floatUp 1.5s forwards;
    pointer-events: none;
    z-index: 100;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    100% {
        transform: translateY(-50px);
        opacity: 0;
    }
}

/* Layout & Responsive Styles */
.dashboard-card {
    background: rgba(17, 34, 64, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    padding: 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2.5rem;
}

@media (max-width: 900px) {
    .dashboard-card {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }

    .sim-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2x2 Grid */
        gap: 0.75rem;
    }

    .sim-sidebar h3 {
        grid-column: 1 / -1;
        margin-bottom: 0.5rem;
    }

    .sim-info-box {
        grid-column: 1 / -1;
        /* Make disclaimer span full width */
        margin-top: 1rem;
        padding: 0.75rem !important;
        background: rgba(245, 158, 11, 0.02) !important;
        border-color: rgba(245, 158, 11, 0.1) !important;
        order: 10;
        /* Move to bottom if flex, but grid positioning handles ordering */
    }

    .sim-info-box p {
        font-size: 0.6rem !important;
        /* Smaller text */
        opacity: 0.7;
    }

    .sim-scene {
        height: 280px;
        /* Reduced height to minimize cropping */
    }

    .gauge-container {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    /* Stack the status bar components */
    .sim-status-bar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .sim-status-bar {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .status-group {
        width: 100%;
        justify-content: space-between;
    }

    /* Scene & Controls Stack */
    .sim-scene-wrapper {
        grid-template-columns: 1fr !important;
    }

    .sim-scene {
        height: 250px;
        /* Even smaller height for mobile to fit everything */
    }

    .sim-controls {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        /* 3 buttons side by side if space permits, or stack */
        gap: 0.75rem;
    }

    @media (max-width: 600px) {
        .sim-controls {
            grid-template-columns: 1fr;
            /* Stack vertically on very small screens */
        }
    }
}

/* Default Desktop Wrapper Style (Moved from Inline) */
.sim-scene-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
}