.form-group {
    margin-bottom: 20px;
}
.form-group.level {
    background-color: var(--bg3);
    padding: 25px;
    border: 1px dashed var(--border);
    margin-bottom: 35px;
    border-radius: 4px;
}

.form-group-title {
    color: var(--text);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
}

.form-group label, .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.form-group label span, .form-label span {
    color: var(--text2);
    font-weight: normal;
    font-size: 0.8rem;
    margin-left: 5px;
}

.form-error-text {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-input, .form-select, .form-textarea, .form-field {
    width: 100%;
    background-color: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 12px;
    font-family: var(--typography);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    outline: none;

    &:focus {
        border-color: var(--rhpz-orange);
    }
    &:disabled {
        background-color: var(--bg3);
        color: var(--text);
    }
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.form-checkbox, .form-radio {
    accent-color: var(--rhpz-orange);
    background-color: var(--bg2);
    border: 1px solid var(--border);
}

.game-selector {
    position: relative;
    width: 100%;
}

.game-selector-level2 {
    position: relative;
    z-index: 1;
}

.game-selector-dropdown {
    position: absolute !important;
    width: 100%;
    min-width: 100%;
    top: calc(100% + 0.35rem);
    left: 0;
    margin: 0;
    padding: 0.35rem 0;
    z-index: 9999;
    max-height: 260px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg2);
    border: 1px solid var(--border);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);
    list-style: none;
    will-change: transform, opacity;
}

.game-selector-dropdown::-webkit-scrollbar {
    width: 8px;
}

.game-selector-dropdown::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
}

.game-selector-dropdown li {
    margin: 0;
}

.dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: transparent;
    border: none;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--text);
    outline: none;
}

.dropdown-item[selected],
.dropdown-item.selected,
.dropdown-item.is-selected {
    background-color: rgba(255, 115, 0, 0.15);
}

.dropdown-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-empty {
    padding: 0.85rem 1rem;
    color: var(--text2);
}

.form-upload {
    position: relative;
    display: flex;
    align-items: center;
    .disabled {
        opacity: 0.5;
        pointer-events: none;
    }
    input[type="file"] {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }
}

.form-upload-placeholder {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg2);
    border: 1px dashed var(--border);
    padding: 12px;
    color: var(--text);
    transition: border-color 0.2s, background-color 0.2s;
}
.form-upload-placeholder.level {
    padding: 30px;
    text-align: center;
    display: block;
    background-color: var(--bg);
}

.form-upload:hover .form-upload-placeholder {
    border-color: var(--rhpz-orange);
    background-color: rgba(255, 115, 0, 0.05);
}

.form-type-of-checkboxes {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;

    label {
        box-sizing: border-box;
        margin: 0;
    }

    input[type="checkbox"] {
        transform: scale(1.5);
        margin-right: 1.33rem;
    }
}

.form-status-radio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;

    label {
        box-sizing: border-box;
        margin: 0;
    }

    input[type="radio"] {
        transform: scale(1.5);
        margin-right: 1.33rem;
    }
}

.languages-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.language-search {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: var(--bg3);
    border: 1px solid var(--border);
    padding: 0 10px;
    height: 36px;
}
.language-search input {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
}
.language-search [data-lucide] {
    color: var(--text2);
    flex-shrink: 0;
}
.language-search .btn {
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.language-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--bg3);
    border: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--rhpz-orange);
    padding: 2%;
}
.language-item {
    display: flex;
    align-items: center;
    gap: 15px;
    accent-color: var(--rhpz-orange);
}
.main-image-grid {
    display: flex;
    flex-direction: row;
    gap: 1rem;
}
.form-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    height: 100%;
    min-height: 120px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    color: var(--text2);
}
.form-image-preview {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.form-image-preview-wrap {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 16/9;

    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

}
.form-image-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background-color: var(--bg2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    transition: background-color 0.15s;

    &:hover {
        background-color: var(--bg3);
    }
}
.form-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}
.gallery-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.gallery-item {
    position: relative;
    cursor: grab;
    transition: opacity 0.2s, transform 0.15s;
    user-select: none;
}

.gallery-item:active { cursor: grabbing; }

.gallery-item--dragging {
    opacity: 0.4;
    transform: scale(0.97);
}

.gallery-drag-handle {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 10;
    background-color: rgba(0,0,0,0.6);
    color: #fff;
    padding: 3px 4px;
    display: flex;
    align-items: center;
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s;
}

.gallery-item:hover .gallery-drag-handle { opacity: 1; }

.gallery-order-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    z-index: 10;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    min-width: 20px;
    text-align: center;
}
.authors-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    button {
        padding: 5px;
    }
}
.submit {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
}
.submit-level {
    display: flex;
    align-items: center;
    gap: 15px;
}
.nsfw-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.upload-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 12px;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--bg2);
    transition: background-color 0.15s, border-color 0.15s;

    & > [data-lucide] {
        flex-shrink: 0;
        width: 20px;
        height: 20px;
    }

}
.upload-item-uploading {
    border-color: var(--border);
    background-color: var(--bg2);

    & > [data-lucide] {
        color: var(--text2);
    }
}
.upload-item-done {
    border-color: color-mix(in srgb, var(--rhpz-orange) 40%, transparent);
    background-color: color-mix(in srgb, var(--rhpz-orange) 6%, transparent);

    & > [data-lucide] {
        color: var(--rhpz-orange);
    }
}
.upload-item-error {
    border-color: color-mix(in srgb, var(--error) 40%, transparent);
    background: color-mix(in srgb, var(--error) 6%, transparent);

    & > [data-lucide] {
        color: var(--error);
    }
}
.upload-item-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}
.upload-item-name {
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.progress {
    height: 6px;
    background-color: var(--bg3);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}
.progress-bar {
    height: 100%;
    background-color: var(--rhpz-orange);
    border-radius: 99px;
    transition: width 0.2s ease;
    min-width: 4px;
}
.progress-bar-label {
    position: absolute;
    top: -18px;
    right: 0;
    font-size: 11px;
    color: var(--text2);
    white-space: nowrap;
}
.upload-item-actions {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

@media (max-width: 600px) {
    .upload-item-actions {
        flex-direction: column;
        gap: 8px;
    }

    .upload-item-actions .btn {
        width: 100%;
    }
}
.file-state-icon { width: 18px; height: 18px; }
.file-state-icon--public   { color: var(--success); }
.file-state-icon--private  { color: var(--text2); }
.file-state-icon--archived { color: var(--error); }

.upload-item-state { display: flex; align-items: center; gap: 8px; }

.author-search { position: relative; }

.author-search-input {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    padding: 8px 12px;
}

.author-search-input .form-input {
    border: none;
    padding: 0;
    background: none;
    flex: 1;
}

.author-search-selected {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--success);
    font-size: 0.85rem;
    white-space: nowrap;
}

.author-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg2);
    border: 1px solid var(--border);
    border-top: none;
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
}

.author-search-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.88rem;
    cursor: pointer;
    text-align: left;
    font-family: var(--typography);
    transition: background-color 0.1s;
}

.author-search-item:hover { background-color: var(--bg3); }

.game-selector-mode {
    display: flex;
    gap: 0;
    margin-bottom: 15px;
    border: 1px solid var(--border);
}

.game-selector-mode-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: none;
    border: none;
    border-right: 1px solid var(--border);
    color: var(--text2);
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-family);
    transition: background-color 0.1s, color 0.1s;
}

.game-selector-mode-btn:last-child {
    border-right: none;
}

.game-selector-mode-btn:hover {
    background-color: var(--bg3);
    color: var(--text);
}

.game-selector-mode-btn.active {
    background-color: var(--bg3);
    color: var(--rhpz-orange);
    border-bottom: 2px solid var(--rhpz-orange);
}

.game-selector-platform-only {
    grid-column: span 1;
}

@media (max-width: 768px) {
    .form-group.level {
        padding: 20px;
        margin-bottom: 25px;
    }

    .form-group-title {
        font-size: 1rem;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }

    .form-group label, .form-label {
        margin-bottom: 6px;
        font-size: 0.9rem;
    }

    .form-input, .form-select, .form-textarea, .form-field {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .form-textarea {
        min-height: 100px;
    }

    .game-selector-mode {
        flex-direction: column;
        gap: 0;
    }

    .game-selector-mode-btn {
        padding: 10px 12px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .game-selector-mode-btn:last-child {
        border-bottom: none;
    }

    .submit, .submit-level, .main-image-grid {
        flex-direction: column;
    }

    .grid-hashes {
        grid-template-columns: 1fr;
    }

    .hash-first {
        display: none;
    }
}

@media (max-width: 600px) {
    .form-group {
        margin-bottom: 15px;
    }

    .form-group.level {
        padding: 15px;
        margin-bottom: 20px;
    }

    .form-group-title {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .form-group label, .form-label {
        font-size: 0.85rem;
    }

    .form-input, .form-select, .form-textarea, .form-field {
        padding: 6px 8px;
        font-size: 0.85rem;
    }

    .form-error-text {
        font-size: 0.8rem;
    }
}
