/* CSV Editor Styles - Apple-inspired */

.csv-editor-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.csv-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.csv-editor-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.csv-editor-save-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #007aff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.csv-editor-save-btn:hover {
    background: #0051d5;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.csv-editor-save-btn:active {
    transform: translateY(0);
}

.csv-editor-save-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.csv-editor-save-btn.saving {
    background: #f59e0b;
}

.save-icon {
    font-size: 16px;
}

.csv-editor-status {
    font-size: 13px;
    font-weight: 500;
    min-width: 100px;
    text-align: right;
}

.csv-editor-status.saving {
    color: #f59e0b;
}

.csv-editor-status.success {
    color: #10b981;
}

.csv-editor-status.error {
    color: #ef4444;
}

.csv-editor-grid {
    background: white;
}

.csv-editor-error {
    padding: 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 14px;
    margin: 20px 0;
}

/* Handsontable customization */
.handsontable {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif !important;
    font-size: 13px;
}

/* Fix row header alignment */
.handsontable .ht_clone_top_inline_start_corner thead tr th,
.handsontable .ht_clone_inline_start thead tr th,
.handsontable thead tr th {
    height: 25px !important;
    line-height: 25px !important;
}

.handsontable .ht_clone_top_inline_start_corner tbody tr th,
.handsontable .ht_clone_inline_start tbody tr th,
.handsontable tbody tr th {
    height: 23px !important;
    line-height: 23px !important;
    vertical-align: middle !important;
}

.handsontable tbody tr td {
    height: 23px !important;
    line-height: 23px !important;
    vertical-align: middle !important;
}

/* Ensure row headers are properly sized */
.handsontable th.ht__row_header {
    height: 23px !important;
    min-height: 23px !important;
    max-height: 23px !important;
}

.handsontable td {
    height: 23px !important;
    min-height: 23px !important;
}

.handsontable th {
    background: #f9fafb;
    color: #6b7280;
    font-weight: 600;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.handsontable td {
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}

.handsontable td.current {
    background: #eff6ff !important;
}

.handsontable td.area {
    background: #dbeafe !important;
}

/* Color picker styles */
.color-swatch {
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.color-picker-input {
    border: 2px solid #007aff;
    border-radius: 4px;
}

.csv-editor-grid .handsontable td {
    transition: background-color 0.2s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .csv-editor-toolbar {
        flex-wrap: wrap;
    }
    
    .csv-editor-title {
        flex-basis: 100%;
        margin-bottom: 8px;
    }
}