/* Eclipse Protocol - Core Styles */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400;700&display=swap');

:root {
    /* Colors */
    --bg-color: #050510;
    --panel-bg: rgba(20, 30, 40, 0.7);
    --panel-border: 1px solid rgba(0, 243, 255, 0.3);

    --primary-color: #00f3ff;
    /* Neon Cyan */
    --secondary-color: #ff0055;
    /* Neon Red */
    --accent-color: #ffae00;
    /* Amber */
    --text-color: #e0e0e0;
    --text-dim: #8899a6;

    /* Effects */
    --glow-primary: 0 0 10px rgba(0, 243, 255, 0.5);
    --glow-danger: 0 0 10px rgba(255, 0, 85, 0.5);
    --glass-blur: blur(10px);

    /* Spacing */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Roboto', sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    overflow: hidden;
    /* App-like feel */
    background-image:
        radial-gradient(circle at 50% 50%, rgba(0, 243, 255, 0.05) 0%, transparent 60%);
}

#app {
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-rows: 60px 1fr 200px;
    /* Header, Main, Log/Controls */
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    box-sizing: border-box;
}

/* Reusable Classes */
.panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    border: var(--panel-border);
    border-radius: 8px;
    padding: var(--spacing-md);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.title {
    font-family: var(--font-display);
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-shadow: var(--glow-primary);
}

button {
    background: linear-gradient(45deg, transparent 5%, var(--primary-color) 5%);
    color: #000;
    font-family: var(--font-display);
    font-weight: bold;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.2s ease;
}

button:hover {
    background: var(--primary-color);
    box-shadow: var(--glow-primary);
    transform: translateY(-2px);
}

button.danger {
    background: linear-gradient(45deg, transparent 5%, var(--secondary-color) 5%);
    color: white;
}

button.danger:hover {
    background: var(--secondary-color);
    box-shadow: var(--glow-danger);
}

/* Dashboard Modules */
#main-view {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    align-content: start;
}

.resource-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 150px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.resource-value {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: var(--font-display);
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.resource-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0.2;
    font-size: 3rem;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: rgba(10, 20, 30, 0.95);
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    border-radius: 10px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-choices {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--text-dim);
    color: var(--text-color);
    padding: 15px;
    cursor: pointer;
    font-family: var(--font-body);
    text-align: left;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.choice-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--primary-color);
    padding-left: 20px;
}

.choice-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s;
}

.choice-btn:hover::before {
    opacity: 1;
}


/* Actions & Progress */
.action-panel {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--text-dim);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 0.7rem;
    padding: 4px 8px;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s;
}

.action-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: black;
    border-color: var(--primary-color);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    margin-top: 5px;
    border-radius: 2px;
    overflow: hidden;
    display: none;
    /* Hidden by default */
}

.action-progress.active {
    display: block;
}

.action-bar {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.2s linear;
}

/* Module Status */
.module-status {
    font-size: 0.7rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}


/* Floating Text */
.floating-text {
    position: absolute;
    pointer-events: none;
    font-weight: bold;
    font-family: var(--font-display);
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    animation: floatUp 1s ease-out forwards;
    z-index: 9999;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-50px) scale(1.2);
        opacity: 0;
    }
}

/* Overdrive Pulse */
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 5px var(--secondary-color);
        border-color: var(--secondary-color);
    }

    50% {
        box-shadow: 0 0 20px var(--secondary-color);
        border-color: #ff5555;
    }

    100% {
        box-shadow: 0 0 5px var(--secondary-color);
        border-color: var(--secondary-color);
    }
}

.overdrive-active {
    animation: pulse-red 1s infinite;
}


/* Crew Panel */
#crew-panel {
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--text-dim);
}

.crew-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.crew-member {
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: 4px;
    font-size: 0.8rem;
    width: 120px;
    position: relative;
}

.crew-name {
    color: var(--primary-color);
    font-weight: bold;
}

.impostor-tell {
    color: purple;
    /* Debug purposes only, remove in prod */
    display: none;
}


/* UI OVERHAUL */

/* Hide Legacy Log */
#event-log {
    display: none !important;
}

/* Sidebar Log */
#sidebar-log {
    position: fixed;
    right: 0;
    top: 60px;
    /* Below header */
    width: 320px;
    height: calc(100vh - 60px);
    background: rgba(10, 15, 20, 0.98);
    border-left: 2px solid var(--primary-color);
    padding: 15px;
    overflow-y: auto;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    transform: translateX(100%);
    /* Hidden by default */
    box-shadow: -10px 0 20px rgba(0, 0, 0, 0.5);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
}

#sidebar-log.active {
    transform: translateX(0);
}

#sidebar-toggle {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 201;
    background: black;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 5px 15px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.8rem;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

#sidebar-toggle:hover {
    background: var(--primary-color);
    color: black;
}

/* Minimap */
#minimap-container {
    margin: 0 auto 20px auto;
    width: 95%;
    height: 200px;
    position: relative;
    background: rgba(0, 5, 10, 0.8);
    border: 1px solid #333;
    border-radius: 4px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 5px;
    padding: 10px;
}

.map-module {
    border: 1px solid #444;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-dim);
    position: relative;
}

.map-module:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Specific Module Positions */
#map-reactor {
    grid-area: 2 / 2 / 3 / 3;
    border-color: var(--primary-color);
    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.1);
}

#map-security {
    grid-area: 2 / 3 / 3 / 4;
    border-color: var(--secondary-color);
    box-shadow: inset 0 0 10px rgba(255, 0, 85, 0.1);
}

#map-research {
    grid-area: 1 / 2 / 2 / 4;
    border-color: #aaff00;
}

#map-comms {
    grid-area: 3 / 3 / 4 / 4;
    border-color: #00ccff;
}

#map-dorms {
    grid-area: 2 / 1 / 3 / 2;
    border-color: #ff00ff;
}

#map-exterior {
    grid-area: 2 / 5 / 3 / 6;
    border: 1px dashed var(--accent-color);
    background: rgba(255, 174, 0, 0.05);
}

#map-corridor-1 {
    grid-area: 2 / 4 / 3 / 5;
    border: 1px solid #666;
    opacity: 1;
}

/* Doors */
.door {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #444;
    border: 1px solid #666;
    z-index: 5;
}

.crew-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 4px white;
    transition: all 1s ease-in-out;
    z-index: 10;
}