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

body {
    font-family: Arial, sans-serif;
    background: url('resources/mars.jpg') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    overflow: hidden;
}

/* OPTION 4 - Mars rover gradient (saved for later)
.button-container {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(10px);
    background: rgba(40, 35, 30, 0.7);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(210, 105, 60, 0.4);
}

.button-container button {
    padding: 8px 16px;
    background: linear-gradient(145deg, rgba(210, 105, 60, 0.9), rgba(180, 85, 50, 0.9));
    color: #f4e4d4;
    border: 1px solid rgba(255, 140, 60, 0.5);
    border-radius: 8px;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 180, 120, 0.3);
    transition: all 0.2s ease;
    width: 130px;
    text-align: center;
}

.button-container button:hover {
    background: linear-gradient(145deg, rgba(230, 115, 70, 0.95), rgba(200, 95, 60, 0.95));
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 180, 120, 0.4);
}

.button-container button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 180, 120, 0.2);
}
*/

/* OPTION 3 - Metallic/Rover control panel (ACTIVE) */
.button-container {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(8px);
    background: rgba(40, 35, 30, 0.85);
    padding: 15px;
    border-radius: 12px;
    border: 2px solid rgba(210, 105, 60, 0.6);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 140, 60, 0.1);
}

.button-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.button-container button {
    padding: 10px 16px;
    background: rgba(40, 35, 30, 0.9);
    color: #f4e4d4;
    border: 2px solid rgba(210, 105, 60, 0.6);
    border-radius: 6px;
    font-size: 14px;
    font-weight: normal;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    width: 130px;
    text-align: center;
}

.button-container button:hover {
    background: rgba(50, 45, 40, 0.95);
    border-color: rgba(230, 115, 60, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(255, 140, 60, 0.2);
}

.button-container button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Bottom Dashboard */
.bottom-dashboard {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 35px;
    z-index: 2000;
    backdrop-filter: blur(8px);
    background: rgba(40, 35, 30, 0.85);
    padding: 12px 25px;
    border-radius: 12px;
    border: 2px solid rgba(210, 105, 60, 0.6);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 140, 60, 0.1);
    color: #f4e4d4;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.bottom-dashboard .counter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.bottom-dashboard .counter-item span:last-child {
    color: #FFD700; /* Gold for numbers */
    font-size: 20px;
}

.bottom-dashboard button {
    padding: 10px 24px;
    background: rgba(40, 35, 30, 0.9);
    color: #f4e4d4;
    border: 2px solid rgba(210, 105, 60, 0.6);
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.bottom-dashboard button:hover {
    background: rgba(50, 45, 40, 0.95);
    border-color: rgba(230, 115, 60, 0.8);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(255, 140, 60, 0.2);
}

.bottom-dashboard button:active {
    background: rgba(60, 55, 50, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
}

/* Grid overlay */
#gridOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#gridOverlay.visible {
    opacity: 1;
}

.grid-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

/* Toast notification */
#toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    backdrop-filter: blur(8px);
    background: rgba(40, 35, 30, 0.9);
    color: #f4e4d4;
    padding: 12px 24px;
    border: 2px solid rgba(210, 105, 60, 0.6);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 0 15px rgba(255, 140, 60, 0.15);
    font-size: 16px;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#toast.show {
    opacity: 1;
}

#toast.top {
    bottom: auto;
    top: 20px;
}

@keyframes pulse-highlight {
    0% { box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.4); }
    50% { box-shadow: 0 0 25px 8px rgba(255, 215, 0, 0.7); }
    100% { box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.4); }
}

.module-highlight {
    animation: pulse-highlight 1.5s infinite;
    border-color: #FFD700 !important;
    z-index: 100;
}

.image-wrapper {
    position: absolute;
    width: 240px;
    opacity: 0;
    transition: opacity 0.3s ease, left 0.3s ease-out, top 0.3s ease-out;
}

.image-wrapper.loaded {
    opacity: 1;
}

.image-wrapper.dragging,
.image-wrapper.dragging * {
    transition: none !important;
}

.draggable {
    cursor: pointer;
    user-select: none;
    border: 3px solid white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.6s;
    transform-style: preserve-3d;
    width: 240px;
    height: auto;
    display: block;
}

.draggable.flipping {
    animation: flip 0.6s;
}

@keyframes flip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

.draggable:hover {
    transform: scale(1.05);
}

.draggable:active {
    cursor: grabbing;
    z-index: 1000;
}

.draggable.selected {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.flip-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: white;
    border: 2px solid #4a4a4a;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    transition: all 0.2s ease;
}

.flip-btn:hover {
    transform: scale(1.1);
    background: #f0f0f0;
}

.flip-btn:active {
    transform: scale(0.95);
}

#wrapper1 {
    top: 150px;
    left: 200px;
}

#wrapper2 {
    top: 150px;
    left: 450px;
}

#wrapper3 {
    top: 150px;
    left: 700px;
}

#wrapper4 {
    top: 325px;
    left: 200px;
}

#wrapper5 {
    top: 325px;
    left: 450px;
}

#wrapper6 {
    top: 325px;
    left: 700px;
}
