/* --- Holographic Sci-Fi Theme --- */
:root {
    --bg-color: #0b0f19;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(0, 243, 255, 0.2);
    --hover-bg: rgba(0, 243, 255, 0.1);

    --neon-cyan: #00f3ff;
    --neon-pink: #bc13fe;
    --text-main: #ffffff;
    --text-muted: #94a3b8;

    --card-radius: 16px;
    --glow-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
}

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Inter:wght@300;400;600&display=swap');

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 0%, #1a233b 0%, #0b0f19 100%);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

h1,
h2,
h3,
.label,
.hero h1,
.chat-title {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

/* --- Canvas Background --- */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
    /* Let clicks pass through, JS handles interaction */
}

/* --- Utility --- */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
    text-align: center;
}

/* --- Menu Button --- */
.menu-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(11, 15, 25, 0.9);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--neon-cyan);
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background: var(--neon-cyan);
    color: #0b0f19;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
}

/* --- Compact Dropdown Menu --- */
/* Class name standardized to 'compact-menu' to match JS injection and kart styles */
.compact-menu {
    position: fixed;
    top: 75px;
    right: 20px;
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 8px;
    display: none;
    /* Default hidden */
    flex-direction: column;
    gap: 4px;
    z-index: 999;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 180px;
    /* Reset old styles */
    width: auto;
    height: auto;
    left: auto;
    transform: none;
    align-items: stretch;
}

.compact-menu.open {
    display: flex;
    transform: none;
}

.compact-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
    /* Reset old styles */
    font-weight: 400;
    -webkit-text-stroke: 0;
    text-transform: none;
    text-shadow: none;
}

.compact-menu a:hover {
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
    transform: none;
    -webkit-text-stroke: 0;
    text-shadow: none;
}

.compact-menu a.active {
    background: rgba(0, 243, 255, 0.15);
    color: var(--neon-cyan);
}

.compact-menu a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.close-menu-text {
    display: none;
    /* Hide the 'Click to close' text for compact menu */
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: 5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff 0%, var(--neon-cyan) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.3));
    animation: float 6s ease-in-out infinite;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.6;
    margin-top: 20px;
    letter-spacing: 1px;
}

/* --- Hero Button --- */
.hero-btn {
    margin-top: 50px;
    padding: 16px 40px;
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    backdrop-filter: blur(5px);
}

.hero-btn:hover {
    background: var(--neon-cyan);
    color: var(--bg-color);
    box-shadow: 0 0 40px var(--neon-cyan);
    transform: translateY(-5px);
    border-color: var(--neon-cyan);
}

/* --- Admin Grid --- */
.admin-header {
    margin-top: 100px;
    margin-bottom: 60px;
    text-align: center;
}

.admin-header h1 {
    font-size: 3rem;
    background: linear-gradient(to right, #fff, var(--text-muted));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.admin-header p {
    color: var(--neon-cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-top: 10px;
    opacity: 0.8;
}

/* Toolbar */
.grid-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
    max-width: 1400px;
    /* Match container */
    width: 100%;
    padding: 0 20px;
}

.toolbar-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.toolbar-btn:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.toolbar-btn.active {
    background: rgba(255, 42, 42, 0.1);
    border-color: #ff2a2a;
    color: #ff2a2a;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    width: 100%;
    padding: 20px;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 40px 20px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 240px;
    overflow: hidden;
}

.card:hover {
    background: var(--hover-bg);
    border-color: var(--neon-cyan);
    transform: translateY(-10px);
    box-shadow: var(--glow-shadow);
}

.card.dragging {
    opacity: 0.4;
    transform: scale(0.95);
    border: 2px dashed var(--neon-cyan);
}

.icon {
    font-size: 3.5rem;
    margin-bottom: 25px;
    color: var(--text-muted);
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 0 transparent);
}

.card:hover .icon {
    color: var(--neon-cyan);
    filter: drop-shadow(0 0 15px var(--neon-cyan));
    transform: scale(1.1);
}

.label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}

.desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.7;
}

/* --- Floating Chat Widget --- */
.chat-widget-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 55px;
    height: 55px;
    background: var(--neon-cyan);
    border: none;
    border-radius: 50%;
    color: #0b0f19;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 5px 25px rgba(0, 243, 255, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: none;
}

.chat-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 35px rgba(0, 243, 255, 0.6);
}

.chat-window {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 350px;
    height: 450px;
    background: rgba(11, 15, 25, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 999;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: none;
    opacity: 1;
    transition: none;
}

.chat-window.open {
    display: flex;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.chat-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-chat {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-chat:hover {
    color: #ef4444;
}

.messages-area {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-row {
    display: flex;
}

.message-row.bot {
    justify-content: flex-start;
}

.message-row.user {
    justify-content: flex-end;
}

.bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: none;
}

.message-row.bot .bubble {
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
    border: 1px solid var(--glass-border);
    border-bottom-left-radius: 2px;
}

.message-row.user .bubble {
    background: var(--neon-cyan);
    color: #0b0f19;
    border-bottom-right-radius: 2px;
}

.input-area {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.chat-input:focus {
    border-color: var(--neon-cyan);
    background: rgba(255, 255, 255, 0.1);
}

.send-btn {
    background: var(--neon-cyan);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #0b0f19;
    transition: transform 0.2s;
    font-size: 1rem;
}

.send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--neon-cyan);
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.4);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(0, 243, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0);
    }
}

@media (max-width: 600px) {
    .hero h1 {
        font-size: 3rem;
        /* Smaller hero text */
    }

    .hero p {
        font-size: 1rem;
        padding: 0 20px;
    }

    /* Mobile Menu Polish */
    .compact-menu {
        width: 90%;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        /* Centered */
        top: 80px;
    }

    /* Mobile Grid */
    .grid {
        grid-template-columns: 1fr;
        /* Single column */
        padding: 10px;
    }

    /* Mobile Chat */
    .chat-window {
        width: 100%;
        height: 100dvh;
        /* Dynamic viewport height */
        bottom: 0;
        right: 0;
        border-radius: 0;
        border: none;
        z-index: 2000;
        /* Above everything */
    }

    .chat-header {
        padding: 15px;
        background: rgba(11, 15, 25, 0.95);
        /* Solid background */
    }

    .menu-btn {
        top: 15px;
        right: 15px;
    }
}