/* css/components/forms.css - Styles des formulaires (nettoyé) */

/* Form containers */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-row {
    display: flex;
    gap: var(--space-md);
    align-items: end;
}

.form-row .input-group,
.form-row .form-group {
    flex: 1;
}

/* Input groups */
.input-group,
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.input-group.horizontal {
    flex-direction: row;
    align-items: center;
    gap: var(--space-md);
}

/* Checkbox and Radio */
.checkbox, .radio {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.checkbox-input, .radio-input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.checkbox-input {
    border-radius: var(--radius-sm);
}

.radio-input {
    border-radius: var(--radius-round);
}

.checkbox-label, .radio-label {
    font-size: var(--font-size-sm);
    cursor: pointer;
    user-select: none;
}

/* Legacy switch styles removed - using Material Design switch instead */

/* Form validation */
.form-error {
    color: var(--error);
    font-size: var(--font-size-xs);
    margin-top: var(--space-xs);
}

.form-success {
    color: var(--success);
    font-size: var(--font-size-xs);
    margin-top: var(--space-xs);
}

.form-help {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    margin-top: var(--space-xs);
}

/* Form actions */
.form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
    margin-top: var(--space-lg);
}

.form-actions.center {
    justify-content: center;
}

.form-actions.start {
    justify-content: flex-start;
}

.form-actions.space-between {
    justify-content: space-between;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.dropdown-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    margin-top: var(--space-xs);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    font-size: var(--font-size-sm);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-xs) 0;
}

/* Search input */
.search-input {
    position: relative;
}

.search-input .input-field {
    padding-left: calc(var(--space-md) + 24px);
    padding-right: calc(var(--space-md) + 24px);
}

.search-input .search-icon {
    position: absolute;
    left: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    pointer-events: none;
}

.search-input .clear-btn {
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.search-input .clear-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* File input */
.file-input {
    position: relative;
    display: inline-block;
}

.file-input-hidden {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.file-input-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-input-button:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

/* Range input */
.range-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-light);
    outline: none;
    appearance: none;
    cursor: pointer;
}

.range-input::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}