@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
    --bg: #080808;
    --surface: #111111;
    --stroke: #222222;
    --accent: #ffffff;
    --text-dim: #777777;
    --radius: 16px;
}

body.create-page {
    background-color: var(--bg);
    color: white;
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 100px 20px 40px 20px; /* Space for Top Nav */
    display: flex;
    justify-content: center;
}

.create-container {
    width: 100%;
    max-width: 1000px;
    animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

h1 { font-size: 2.5rem; font-weight: 900; margin-bottom: 40px; letter-spacing: -1.5px; }

.form-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.input-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 25px; }

label { font-size: 0.75rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1.5px; }

input, textarea, select {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 16px;
    color: white;
    outline: none;
    transition: all 0.2s ease;
    font-size: 1rem;
}

input:focus, textarea:focus { border-color: #444; background: #161616; }

/* Game Search Dropdown */
.game-search-box {
    position: relative; /* Essential for the dropdown to align */
}

.game-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #181818 !important;
    border: 1px solid #333;
    z-index: 99999 !important; /* This ensures it floats on top */
    display: none;
    max-height: 250px;
    overflow-y: auto;
}

.labels-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.label-chip {
    background: #161616;
    border: 1px solid var(--stroke);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: popIn 0.2s ease-out;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.label-chip span {
    font-weight: 500;
}

.label-chip .remove-btn {
    cursor: pointer;
    color: var(--text-dim);
    font-weight: 800;
    transition: color 0.2s;
    font-size: 1.1rem;
    line-height: 1;
}

.label-chip .remove-btn:hover {
    color: #ff4d4d;
}

.game-item { padding: 12px; display: flex; align-items: center; gap: 15px; cursor: pointer; }
.game-item:hover { background: #222; }
.game-item img { width: 45px; height: 45px; border-radius: 8px; object-fit: cover; }

/* Custom Checkbox */
.checkbox-wrapper { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.checkbox-wrapper input { display: none; }
.custom-check {
    width: 22px; height: 22px; border: 2px solid var(--stroke);
    border-radius: 6px; transition: 0.2s; position: relative;
}
input:checked + .custom-check { background: white; border-color: white; }
input:checked + .custom-check::after { content: '✓'; color: black; position: absolute; font-weight: 900; left: 4px; top: -1px; }

/* Code Editor */
.editor-container {
    background: #050505; border: 1px solid var(--stroke);
    border-radius: 16px; overflow: hidden; margin-top: 10px;
}
.editor-header {
    background: #111; padding: 14px 20px; font-size: 0.75rem;
    color: var(--text-dim); border-bottom: 1px solid var(--stroke);
    display: flex; justify-content: space-between; align-items: center;
}
.editor-area {
    width: 100%; height: 350px; background: transparent; border: none;
    padding: 25px; font-family: 'Fira Code', monospace; color: #e0e0e0;
    resize: vertical; line-height: 1.6;
}

.publish-btn {
    background: white; color: black; border: none;
    padding: 20px; border-radius: 14px; font-weight: 900;
    font-size: 1.1rem; cursor: pointer; width: 100%;
    margin-top: 20px; transition: 0.3s;
}
.publish-btn:hover { background: #cccccc; transform: scale(0.99); }

#game-preview {
    width: 100%;
    height: 200px;
    background-color: #0a0a0a;
    border: 2px dashed var(--stroke);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    overflow: hidden; /* Keeps the image inside the rounded corners */
}

/* Subtle glow when an image is loaded */
#game-preview[style*="background-image"] {
    border: 1px solid var(--stroke);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
