:root {
    --color-bg: #0f0c29;
    /** Deep purple/black bg */
    --color-primary: #302b63;
    --color-secondary: #24243e;
    --color-accent: #00e5ff;
    /** Cyan */
    --color-success: #00ff00;
    /** Matrix Green */
    --color-warning: #ffeb3b;
    --color-danger: #ff0055;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --font-main: 'Outfit', sans-serif;
    --color-rainbow: linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    background-image:
        url("data:image/svg+xml,%3Csvg width='300' height='300' viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='translate(150,150)'%3E%3Ctext x='0' y='0' font-family='monospace' font-size='25' font-weight='bold' fill='rgba(0, 255, 0, 0.03)' transform='rotate(-45)' text-anchor='middle' dominant-baseline='central'%3EWACKEY DATA%3C/text%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(135deg, var(--color-bg), var(--color-primary), var(--color-secondary));
    color: white;
    min-height: 100vh;
    padding-bottom: 50px;
    /* Space for footer/nav */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.rainbow-text {
    background: var(--color-rainbow);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 5s ease infinite;
    background-size: 400% 400%;
}

@keyframes rainbow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Floating Animation */
.floating {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Wacky Buttons Global (Fallback/Base) */
.wacky-btn {
    background: var(--glass-bg);
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s;

    /* UNIVERSAL TOOLTIPS */
    .info-icon {
        display: inline-flex;
        justify-content: center;
        align-items: center;
        width: 16px;
        height: 16px;
        border: 1px solid var(--color-accent);
        color: var(--color-accent);
        border-radius: 50%;
        font-size: 10px;
        margin-left: 5px;
        cursor: help;
        font-family: monospace;
        transition: all 0.3s;
    }

    .info-icon:hover {
        background: var(--color-accent);
        color: #000;
        box-shadow: 0 0 10px var(--color-accent);
    }

    /* Tooltip Popup */
    [data-tooltip] {
        position: relative;
    }

    [data-tooltip]:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 110%;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.9);
        border: 1px solid var(--color-accent);
        color: #fff;
        padding: 5px 10px;
        font-size: 0.7rem;
        border-radius: 5px;
        white-space: nowrap;
        z-index: 1000;
        pointer-events: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    }

    /* P11: API NODES */
    .api-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .api-node {
        background: rgba(0, 50, 0, 0.3);
        border: 1px solid #0f0;
        padding: 10px;
        text-align: center;
        border-radius: 5px;
    }

    .node-indicator {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        margin: 0 auto 5px auto;
        box-shadow: 0 0 5px currentColor;
    }

    .node-indicator.open {
        background: #0f0;
        color: #0f0;
        box-shadow: 0 0 10px #0f0;
    }

    .node-indicator.busy {
        background: #f00;
        color: #f00;
        animation: pulse-red 1s infinite;
    }

    @keyframes pulse-red {
        0% {
            transform: scale(1);
            opacity: 1;
        }

        50% {
            transform: scale(1.2);
            opacity: 0.7;
        }

        100% {
            transform: scale(1);
            opacity: 1;
        }
    }

    backdrop-filter: blur(5px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.wacky-btn:hover {
    background: var(--color-accent);
    color: var(--color-bg);
    box-shadow: 0 0 20px var(--color-accent);
}

.wacky-btn-action {
    border-color: var(--color-success);
    color: var(--color-success);
}

.wacky-btn-action:hover {
    background: var(--color-success);
    color: black;
    box-shadow: 0 0 20px var(--color-success);
}

/* Inputs */
input,
textarea,
select {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-family: inherit;
    margin-bottom: 1rem;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

/* Utilities */
.text-center {
    text-align: center;
}

.hidden {
    display: none !important;
}

/* TOGGLE BUTTONS (P6) */
.wacky-btn-toggle {
    flex: 1;
    background: transparent;
    border: none;
    color: #888;
    padding: 5px;
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
}

.wacky-btn-toggle.active {
    background: var(--color-accent);
    color: #000;
}

/* FLOATING ANIMATION (P6) */
.wacky-float {
    animation: float-wacky 3s ease-in-out infinite;
    display: inline-block;
}

@keyframes float-wacky {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-5px) rotate(2deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.wacky-box-anim {
    border: 2px dashed #ff00ff;
    animation: border-dance 4s linear infinite;
}

@keyframes border-dance {
    0% {
        border-color: #ff00ff;
    }

    33% {
        border-color: #00e5ff;
    }

    66% {
        border-color: #ffff00;
    }

    100% {
        border-color: #ff00ff;
    }
}

/* SIMULATION MODE (P12) */
body.simulation-active {
    border: 5px solid #00ff00;
    position: relative;
}

body.simulation-active::after {
    content: "SIMULATION MODE ACTIVE - NOT REAL DATA";
    position: fixed;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #ffeb3b;
    padding: 5px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid #ffeb3b;
    z-index: 10000;
    pointer-events: none;
}

/* --- FINAL FEATURE PACK STYLES --- */

/* API Portals */
.api-portal {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #555;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.5s;
}

.api-portal.active {
    background: #0f0;
    box-shadow: 0 0 10px #0f0;
}

.api-portal.occupied {
    background: #f00;
    box-shadow: 0 0 10px #f00;
    animation: pulse-red 1s infinite;
}

/* Assistant Slots */
.assistant-slot {
    border: 1px dashed #333;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.assistant-slot:hover {
    background: rgba(0, 229, 255, 0.1);
}

.slot-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.slot-name {
    font-size: 0.7rem;
    color: #555;
    font-weight: bold;
}

/* --- FINAL FEATURE PACK STYLES --- */

/* API Portals */
.api-portal {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #333;
    border: 1px solid #555;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: all 0.5s;
}

.api-portal.active {
    background: #0f0;
    box-shadow: 0 0 10px #0f0;
}

.api-portal.occupied {
    background: #f00;
    box-shadow: 0 0 10px #f00;
    animation: pulse-red 1s infinite;
}

/* Assistant Slots */
.assistant-slot {
    border: 1px dashed #333;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.assistant-slot:hover {
    background: rgba(0, 229, 255, 0.1);
}

.slot-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.slot-name {
    font-size: 0.7rem;
    color: #555;
    font-weight: bold;
}