/**
 * Input Component Styles
 * Переиспользуемые стили для инпутов с контроллерами
 */

/* Базовые стили для инпутов */
.invoice-form-group input {
    background: var(--color-input-bg);
    border: var(--color-input-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) calc(var(--spacing-md) + 4px);
    font-size: var(--font-size-md);
    color: var(--color-input-text);
    font-family: var(--font-primary);
    transition: all var(--transition-base);
    width: 100%;
    box-sizing: border-box;
}

/* Date inputs с иконкой календаря - стили применяются через flatpickr-wrapper в calendar.css */

.invoice-form-group input.error,
.invoice-item-row input.error {
    border: 1px solid var(--color-text-primary);
    background: var(--color-input-bg-focus);
}

.invoice-form-group input:hover,
.invoice-form-group textarea:hover {
    border: var(--color-input-border);
    background: var(--color-input-bg-hover);
}

.invoice-form-group input:focus,
.invoice-form-group textarea:focus {
    outline: none;
    border: var(--color-input-border-focus);
    background: var(--color-input-bg-focus);
    box-shadow: none;
}

/* Textarea */
.invoice-form-group textarea {
    background: var(--color-input-bg);
    border: var(--color-input-border);
    border-radius: var(--radius-sm);
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) calc(var(--spacing-md) + 4px);
    font-size: var(--font-size-md);
    color: var(--color-input-text);
    font-family: var(--font-primary);
    transition: all var(--transition-base);
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 70px;
}

/* Контроллер для числовых полей */
.invoice-number-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.invoice-number-input-wrapper input {
    padding-right: 36px;
    /* Скрыть системные спиннеры */
    -moz-appearance: textfield;
    appearance: textfield;
}

.invoice-number-input-wrapper input::-webkit-outer-spin-button,
.invoice-number-input-wrapper input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.invoice-number-controls {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 1;
}

.invoice-number-btn {
    background: transparent;
    border: none;
    width: 20px;
    height: 16px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-disabled);
    transition: all var(--transition-base);
    border-radius: var(--spacing-xs);
}

.invoice-number-btn:hover {
    background: var(--color-button-secondary);
    color: var(--color-text-secondary);
}

.invoice-number-btn:active {
    background: var(--color-button-secondary-hover);
    color: var(--color-text-primary);
}

.invoice-number-btn svg {
    width: 8px;
    height: 5px;
    display: block;
}

.invoice-number-btn-up svg {
    transform: translateY(2px);
}

.invoice-number-btn-down svg {
    transform: translateY(-2px);
}

/* Light theme: Invoice inputs - same as chat input */
body.light-theme .invoice-form-group input,
body.light-theme .invoice-form-group textarea {
    background: rgb(240, 240, 240);
    border: 1px solid transparent;
    color: #000000;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

body.light-theme .invoice-form-group input:focus,
body.light-theme .invoice-form-group textarea:focus {
    background: rgb(232, 232, 232);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .invoice-form-group input:hover,
body.light-theme .invoice-form-group textarea:hover {
    background: rgb(232, 232, 232);
    border: 1px solid transparent;
}

body.light-theme .invoice-form-group input.error,
body.light-theme .invoice-form-group textarea.error,
body.light-theme .invoice-item-row input.error {
    border: 1px solid rgba(255, 68, 68, 0.5);
    background: rgba(255, 68, 68, 0.05);
}

body.light-theme .invoice-form-group label {
    color: rgba(0, 0, 0, 0.8);
}

body.light-theme .invoice-error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #dc2626;
}

/* Invoice number controls in light theme */
body.light-theme .invoice-number-btn {
    color: rgba(0, 0, 0, 0.4);
}

body.light-theme .invoice-number-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.8);
}

body.light-theme .invoice-number-btn:active {
    background: rgba(0, 0, 0, 0.12);
    color: #000000;
}

