/* Form Components - Shared across all pages */

/* Form Groups */
.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-primary, #555);
    font-size: 14px;
}

.form-group small {
    display: block;
    color: var(--text-secondary, #666);
    font-size: 0.8rem;
    margin-top: 3px;
}

/* Form Inputs */
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-primary, white);
    color: var(--text-primary, #2c3e50);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary, #3498db);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Textarea */
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    background: var(--bg-primary, white);
    color: var(--text-primary, #2c3e50);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary, #3498db);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Select Dropdown */
.form-select,
.filter-select {
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-primary, white);
    color: var(--text-primary, #2c3e50);
    cursor: pointer;
}

.form-select:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--color-primary, #3498db);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Search Input */
.search-input,
.filter-input {
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-size: 14px;
    background: var(--bg-primary, white);
    color: var(--text-primary, #2c3e50);
    min-width: 150px;
}

.search-input:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--color-primary, #3498db);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Form Help Text */
.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary, #666);
    font-style: italic;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Checkbox */
.show-alt-art {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary, #2c3e50);
}

.show-alt-art input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

/* Filter Groups */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #495057);
}

/* Quantity Input */
.quantity-input {
    width: 40px;
    height: 28px;
    text-align: center;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    font-size: 14px;
    background: var(--bg-primary, white);
    -moz-appearance: textfield;
}

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

.quantity-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Quantity Controls Container */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px;
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
}

/* Color Selector (vertical layout) */
.color-selector-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.color-option {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-option input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

.color-label {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-white, white);
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.color-label.red { background-color: var(--card-color-red); }
.color-label.blue { background-color: var(--card-color-blue); }
.color-label.green { background-color: var(--card-color-green); }
.color-label.yellow { background-color: var(--card-color-yellow); color: var(--text-primary, #333); }
.color-label.purple { background-color: var(--card-color-purple); }
.color-label.white { background-color: var(--card-color-white); color: var(--text-primary, #2c3e50); border: 1px solid var(--border-color-light, #bdc3c7); }
.color-label.black { background-color: var(--card-color-black); }

.color-label:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Dark Theme Support */
body.dark-theme .form-input,
body.dark-theme .form-textarea,
body.dark-theme .form-select,
body.dark-theme .filter-select,
body.dark-theme .search-input,
body.dark-theme .filter-input,
body.dark-theme .quantity-input {
    background: var(--bg-secondary, #34495e);
    color: var(--text-primary, #ecf0f1);
    border-color: var(--border-color, #2c3e50);
}

body.dark-theme .form-group label,
body.dark-theme .filter-group label {
    color: var(--text-primary, #ecf0f1);
}

body.dark-theme .form-help,
body.dark-theme .form-group small {
    color: var(--text-secondary, #95a5a6);
}

body.dark-theme .show-alt-art {
    color: var(--text-primary, #ecf0f1);
}

body.dark-theme .quantity-display {
    color: var(--text-primary, #ecf0f1);
}

body.dark-theme .color-label.white {
    background-color: var(--text-primary, #ecf0f1);
    color: var(--bg-body, #2c3e50);
    border: 1px solid var(--text-muted, #95a5a6);
}

/* Responsive Design */
@media (max-width: 768px) {
    .filter-group {
        min-width: unset;
    }

    .filter-input,
    .search-input {
        min-width: unset;
    }

    .quantity-controls {
        min-width: 100px;
    }
}
