/*
 * Forms Component
 * 入力フォーム、トグルスイッチ、インライン編集のスタイル定義
 */

/* --- Forms & Inputs --- */
.je-label {
    display: block;
    margin-bottom: var(--je-spacing-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--je-text-secondary);
}

.je-input {
    width: 100%;
    padding: 8px 12px;
    background-color: var(--je-bg-secondary);
    color: var(--je-text-primary);
    border: 1px solid var(--je-border-color);
    border-radius: var(--je-radius-sm);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.je-input:focus {
    outline: none;
    border-color: var(--je-accent-color-solid);
    box-shadow: 0 0 0 2px var(--je-accent-color);
}

/* Textarea constraints */
textarea.je-textarea {
    min-height: 120px;
    resize: none;
    overflow-x: hidden;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-family: monospace;
    line-height: 1.5;
}

/* --- Inline Editing Styles --- */
.je-inline-input {
    font-family: inherit;
    font-size: 0.9em;
    color: var(--je-text-primary);
    background-color: var(--je-bg-secondary);
    border: 1px solid var(--je-accent-color-solid);
    border-radius: 4px;
    padding: 2px 4px;
    margin: -3px -5px;
    width: 100%;
    min-width: 120px;
    max-width: 400px;
    outline: none;
    box-shadow: 0 0 0 2px var(--je-accent-color);
}

/* Key specific input adjustment */
input.je-key-input {
    font-weight: 600;
    color: var(--je-accent-color-solid);
    width: auto;
    min-width: 80px;
    margin-right: 4px;
}

/* --- Toggle Switch --- */
.je-toggle-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.je-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.je-toggle-bg {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: var(--je-bg-tertiary);
    border: 1px solid var(--je-border-color);
    border-radius: 9999px;
    transition: background-color 0.2s;
}

.je-toggle-dot {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.je-toggle-input:checked + .je-toggle-bg {
    background-color: var(--je-accent-color-solid);
    border-color: var(--je-accent-color-solid);
}
.je-toggle-input:checked + .je-toggle-bg .je-toggle-dot {
    transform: translateX(16px);
}