/* Spreadsheet Content Type Styles */

.spreadsheet-container {
    width: 100%;
}

.spreadsheet-wrapper {
    min-height: 100px;
}

/* Jspreadsheet base overrides */
.jspreadsheet {
    font-family: inherit;
}

/* Light mode zebra striping and hover */
.jspreadsheet tbody tr:nth-child(even) td {
    background: #f9fafb;
}

.jspreadsheet tbody tr:hover td {
    background: #f3f4f6;
}

/* Dark mode support */
.dark .jspreadsheet {
    background: #1f2937;
    color: #e5e7eb;
}

.dark .jspreadsheet td {
    border-color: #374151;
    background: #111827;
}

.dark .jspreadsheet td.readonly {
    background: #1f2937;
}

.dark .jspreadsheet thead td {
    background: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

.dark .jspreadsheet tbody tr:nth-child(even) td {
    background: #1a2332;
}

.dark .jspreadsheet tbody tr:hover td {
    background: #374151;
}

.dark .jspreadsheet td.highlight {
    background: #065f46 !important;
}

.dark .jspreadsheet .jss_content {
    background: #111827;
}

/* Selected cell */
.dark .jspreadsheet td.selected {
    background: #10b981 !important;
    color: white;
}

/* Dark mode: cell editor input */
.dark .jspreadsheet td input,
.dark .jspreadsheet td textarea,
.dark .jspreadsheet td select {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #4b5563;
}

/* Dark mode: jsuites context menu (disabled but styled as safety net) */
.dark .jcontextmenu {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #374151;
}

.dark .jcontextmenu > div:hover {
    background: #374151;
}

/* Dark mode: jsuites dropdown/picker */
.dark .jdropdown-container {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #374151;
}

/* Dark mode: scrollbar styling for tableOverflow */
.dark .spreadsheet-wrapper ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.dark .spreadsheet-wrapper ::-webkit-scrollbar-track {
    background: #111827;
}

.dark .spreadsheet-wrapper ::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

.dark .spreadsheet-wrapper ::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Dark mode: column and row headers (left gutter) */
.dark .jspreadsheet > thead > tr > td:first-child,
.dark .jspreadsheet > tbody > tr > td:first-child {
    background: #374151;
    color: #9ca3af;
    border-color: #4b5563;
}

/* Responsive spreadsheet */
@media (max-width: 768px) {
    .spreadsheet-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .jspreadsheet {
        min-width: 600px;
    }
}

/* Formula cells */
.jspreadsheet td[data-formula] {
    font-style: italic;
}

/* Currency formatting */
.jspreadsheet td.currency {
    text-align: right;
}

/* Error state */
.spreadsheet-wrapper .error {
    color: #ef4444;
    padding: 1rem;
    font-style: italic;
}

/* Read-only cursor */
.spreadsheet-wrapper .jspreadsheet td {
    cursor: default;
}
