/* float/css/styles.css */
:root {
    --float-accent: #00dbde;
    --float-accent-2: #fc00ff;
    --float-grad: linear-gradient(90deg, #00dbde, #fc00ff);
    --float-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
    --float-shadow-md: 0 5px 15px rgba(0, 0, 0, 0.3);
    --float-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.float-container {
    margin: 2rem 0;
    padding: 0;
}

.float-container h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem;
    background: var(--float-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.25;
}

.float-container > p.lead {
    color: var(--text-color);
    margin: 0 0 1.75rem;
    line-height: 1.7;
    font-size: 0.98rem;
}

.float-container > p.lead strong {
    color: var(--float-accent);
    font-weight: 600;
}

/* ============ Panel ============ */
.panel {
    border: 1px solid var(--header-border);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    background: var(--card-bg);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.panel:hover {
    border-color: rgba(0, 219, 222, 0.35);
}

.panel h3,
.panel h4 {
    margin: 0 0 0.85rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.panel h3 {
    font-size: 1.2rem;
}

.panel h4 {
    font-size: 1.05rem;
}

.panel h3 .icon,
.panel h4 .icon {
    font-size: 1.15em;
    line-height: 1;
}

.desc {
    color: var(--footer-text);
    font-size: 0.88rem;
    margin: 0 0 1rem;
    line-height: 1.65;
}

.desc code {
    background: var(--hover);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: Consolas, Monaco, monospace;
    font-size: 0.85em;
    color: var(--float-accent);
}

/* ============ Emoji ============ */
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.emoji-preset {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.5rem;
    padding: 0.5rem 0.25rem;
    min-height: 2.85rem;
    background: var(--hover);
    border: 1px solid var(--header-border);
    color: var(--text-color);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.emoji-preset:hover:not(:disabled) {
    background: var(--feature-card-hover-bg);
    border-color: var(--float-accent);
    transform: translateY(-2px);
    box-shadow: var(--float-shadow-md);
}

.emoji-preset.active {
    background: linear-gradient(90deg, rgba(0, 219, 222, 0.18), rgba(252, 0, 255, 0.18));
    border-color: rgba(0, 219, 222, 0.8);
    color: var(--text-color);
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-emoji-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.65rem;
}

.custom-emoji-row input {
    flex: 1;
    min-width: 160px;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.15rem;
}

.emoji-preview {
    color: var(--text-color);
    font-size: 0.95rem;
    padding: 0.65rem 0.85rem;
    background: var(--hover);
    border-radius: 10px;
    border: 1px dashed var(--header-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emoji-preview span {
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 1.6rem;
    line-height: 1;
}

/* ============ Buttons ============ */
.float-container button {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: 1px solid var(--header-border);
    background: var(--hover);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, opacity 0.25s ease;
}

.float-container button:hover:not(:disabled) {
    background: var(--feature-card-hover-bg);
    transform: translateY(-2px);
    box-shadow: var(--float-shadow-md);
}

.float-container button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--float-shadow-sm);
}

.float-container button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.float-container button.primary {
    background: linear-gradient(90deg, rgba(0, 219, 222, 0.12), rgba(252, 0, 255, 0.12));
    color: var(--text-color);
    border: 1px solid var(--header-border);
    border-radius: 999px;
    font-weight: 600;
}

.float-container button.primary:hover:not(:disabled) {
    background: linear-gradient(90deg, rgba(0, 219, 222, 0.22), rgba(252, 0, 255, 0.22));
    border-color: rgba(0, 219, 222, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.float-container button.danger {
    background: linear-gradient(90deg, rgba(255, 77, 77, 0.12), rgba(255, 107, 107, 0.12));
    color: var(--column-remove-btn);
    border: 1px solid var(--header-border);
    border-radius: 999px;
}

.float-container button.danger:hover:not(:disabled) {
    background: linear-gradient(90deg, rgba(255, 77, 77, 0.22), rgba(255, 107, 107, 0.22));
    border-color: var(--column-remove-btn);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

#openBtn {
    display: none;
}

/* ============ Inputs ============ */
.float-container input,
.float-container select {
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--input-text);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.float-container input:hover:not(:focus),
.float-container select:hover:not(:focus) {
    border-color: var(--float-accent);
}

.float-container input:focus,
.float-container select:focus {
    outline: none;
    border-color: var(--float-accent);
    box-shadow: 0 0 0 3px rgba(0, 219, 222, 0.18);
}

.float-container input[type="number"] {
    width: 110px;
}

.float-container label {
    color: var(--text-color);
    font-size: 0.9rem;
}

/* ============ Item Row ============ */
.item-row {
    display: grid;
    grid-template-columns: 2.2rem 1fr 1fr 1fr auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    margin: 0.5rem 0;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--hover);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.item-row:hover {
    background: var(--feature-card-hover-bg);
    border-color: var(--header-border);
    box-shadow: var(--float-shadow-sm);
}

.item-row > span {
    color: var(--float-accent);
    font-weight: 700;
    font-size: 0.95rem;
    font-family: Consolas, Monaco, monospace;
}

.item-row .field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.item-row .field label {
    color: var(--footer-text);
    font-size: 0.82rem;
    white-space: nowrap;
}

.item-row .field input,
.item-row .field select {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.item-row .del-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    white-space: nowrap;
    justify-self: end;
}

/* ============ Test Row ============ */
.test-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    background: var(--hover);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.85rem;
    border: 1px dashed var(--header-border);
}

.test-row strong {
    color: var(--text-color);
    flex: 0 0 auto;
}

.test-row .field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 200px;
}

.test-row .field label {
    color: var(--footer-text);
    font-size: 0.82rem;
    white-space: nowrap;
    flex: 0 0 auto;
}

.test-row .field input,
.test-row .field select {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

.test-row > strong {
    margin-right: 0.25rem;
}

.test-row > button {
    flex: 0 0 auto;
}

/* ============ Actions ============ */
.actions {
    margin-top: 0.85rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions button {
    flex: 1 1 auto;
    min-width: 120px;
}

/* ============ Status Badge ============ */
.status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.55rem 0.85rem;
    background: var(--hover);
    border-radius: 8px;
    border: 1px solid var(--header-border);
    font-size: 0.88rem;
    color: var(--text-color);
}

.status-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: var(--footer-text);
    box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.2);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.status-dot.running {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .float-container {
        margin: 1rem 0;
        padding: 0;
    }

    .float-container h1 {
        font-size: 1.5rem;
    }

    .float-container > p.lead {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }

    .panel {
        padding: 1rem;
        border-radius: 10px;
        margin-bottom: 1rem;
    }

    .panel h3 {
        font-size: 1.08rem;
    }

    .panel h4 {
        font-size: 1rem;
    }

    .float-container input[type="number"] {
        width: 100%;
    }

    #openBtn {
        width: 100%;
    }

    .emoji-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }

    .emoji-preset {
        font-size: 1.35rem;
        min-height: 2.6rem;
        padding: 0.4rem 0.2rem;
    }

    .float-container input,
    .float-container select {
        padding: 0.45rem 0.65rem;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Item row: 4-col grid stacks into rows on mobile */
    .item-row {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "idx del"
            "wait wait"
            "mode mode"
            "jit jit";
        gap: 0.4rem;
        padding: 0.65rem;
        max-width: 100%;
        min-width: 0;
    }

    .item-row > span {
        grid-area: idx;
        align-self: center;
    }

    .item-row .del-btn {
        grid-area: del;
        justify-self: end;
    }

    .item-row .field-wait {
        grid-area: wait;
    }

    .item-row .field-mode {
        grid-area: mode;
    }

    .item-row .field-jit {
        grid-area: jit;
    }

    .item-row .field {
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
    }

    .item-row .field input,
    .item-row .field select {
        font-size: 16px;
        width: 100%;
    }

    .item-row .field label {
        font-size: 0.78rem;
        white-space: normal;
    }

    .actions,
    .custom-emoji-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0;
    }

    .test-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.85rem 0.75rem;
    }

    .actions button,
    .test-row button,
    .custom-emoji-row button,
    .test-row .field input,
    .test-row .field select {
        width: 100%;
        min-width: 0;
    }

    .custom-emoji-row input {
        width: 100%;
        min-width: 0;
    }

    .test-row .field {
        width: 100%;
        flex: 0 1 auto;
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
    }

    .test-row .field label {
        font-size: 0.78rem;
        min-width: 0;
        white-space: normal;
    }

    .test-row strong {
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 380px) {
    .emoji-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .float-container h1 {
        font-size: 1.3rem;
    }
}
