/* 
 * Created: Initial CSS file for LocalCollectionControl grid styling
 * Changes: 
 * - Added basic grid layout and styling
 * - Added form control styles
 * - Added validation styles
 * - Added select input styles
 * - Improved layout and sizing
 */

.local-collection-grid {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    table-layout: fixed;
}

.local-collection-grid table {
    width: 100%;
}

.local-collection-grid th,
.local-collection-grid td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column widths */
.local-collection-grid th:nth-child(1),
.local-collection-grid td:nth-child(1) {
    width: 25%;
}

.local-collection-grid th:nth-child(2),
.local-collection-grid td:nth-child(2) {
    width: 25%;
}

.local-collection-grid th:nth-child(3),
.local-collection-grid td:nth-child(3) {
    width: 25%;
}

.local-collection-grid th:nth-child(4),
.local-collection-grid td:nth-child(4) {
    width: 25%;
}

.local-collection-grid th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.local-collection-grid tr:nth-child(even) {
    background-color: #fafafa;
}

.local-collection-grid input,
.local-collection-grid select,
.local-collection-grid textarea {
    width: calc(100% - 12px); /* Account for padding */
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    box-sizing: border-box;
    min-width: 0; /* Prevent select from overflowing */
}

.local-collection-grid select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 24px;
}

.local-collection-grid input:focus,
.local-collection-grid select:focus,
.local-collection-grid textarea:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);
}

.error-field {
    border-color: #d83b01 !important;
}

.error-message {
    color: #d83b01;
    font-size: 12px;
    margin-top: 4px;
}

.grid-actions {
    margin: 1rem 0;
}

.grid-button,
button {
    padding: 6px 12px;
    margin-right: 8px;
    border: 1px solid #0078d4;
    background-color: #0078d4;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    min-width: 80px;
}

.grid-button:hover,
button:hover {
    background-color: #106ebe;
}

.grid-button.secondary {
    background-color: white;
    color: #0078d4;
}

.grid-button.secondary:hover {
    background-color: #f0f0f0;
}

.save-container {
    margin-top: 1rem;
    text-align: right;
}

.new-record-row {
    background-color: #f8f8f8;
} 