/* styles/forms.css - Form Elements & Inputs */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.form-group label .required {
    color: var(--danger-500);
    margin-left: 2px;
}

.form-group .hint {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-1);
}

.form-control {
    width: 100%;
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-control:disabled {
    background: var(--bg-tertiary);
    cursor: not-allowed;
}

.form-control.error {
    border-color: var(--danger-400);
    box-shadow: 0 0 0 3px var(--danger-100);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1;
}

.input-group .form-control:first-child {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: var(--text-sm);
    white-space: nowrap;
}

.input-group-text:first-child {
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    border-right: none;
}

.input-group-text:last-child {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    border-left: none;
}

/* Checkbox & Radio */
.checkbox-group, .radio-group {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    padding: var(--space-2) 0;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--primary-500);
    cursor: pointer;
}

.checkbox-label, .radio-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.checkbox-label strong, .radio-label strong {
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.switch-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider {
    background: var(--primary-500);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(20px);
}

/* Form Section */
.form-section {
    margin-bottom: var(--space-8);
}

.form-section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-section-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
}

.form-section-divider {
    height: 1px;
    background: var(--border-color);
    margin: var(--space-6) 0;
}

/* Tags Input */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    min-height: 42px;
}

.tags-input:focus-within {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    background: var(--primary-50);
    color: var(--primary-700);
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 500;
}

.tag-remove {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.tag-remove:hover {
    background: var(--primary-200);
}

.tags-input input {
    border: none;
    outline: none;
    background: none;
    flex: 1;
    min-width: 100px;
    font-size: var(--text-sm);
    padding: var(--space-1);
}

/* Price Input */
.price-input {
    position: relative;
}

.price-input .currency-symbol {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-weight: 500;
    pointer-events: none;
}

.price-input input {
    padding-left: 32px;
}

/* Date Range */
.date-range {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.date-range input {
    width: 140px;
}

.date-range-separator {
    color: var(--text-tertiary);
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.color-picker-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.color-picker-preview:hover {
    transform: scale(1.1);
}

/* File Upload */
.file-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
    background: var(--bg-secondary);
}

.file-upload-zone:hover, .file-upload-zone.drag-active {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.file-upload-zone-icon {
    width: 48px;
    height: 48px;
    color: var(--text-tertiary);
    margin-bottom: var(--space-4);
}

.file-upload-zone-text {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.file-upload-zone-hint {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

/* Attributes Repeater */
.repeater-item {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    padding: var(--space-4);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    border: 1px solid var(--border-color);
}

.repeater-item .form-group {
    margin-bottom: 0;
    flex: 1;
}

.repeater-remove {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    margin-top: 24px;
    transition: all var(--transition-fast);
}

.repeater-remove:hover {
    background: var(--danger-50);
    color: var(--danger-500);
}

/* Meta Fields */
.meta-fields {
    display: grid;
    gap: var(--space-3);
}

.meta-field {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--space-3);
    align-items: flex-start;
}

.meta-field .form-group {
    margin-bottom: 0;
}

/* Validation Messages */
.error-message {
    font-size: var(--text-xs);
    color: var(--danger-500);
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.error-message::before {
    content: '⚠';
}