/* ================================== */
/* css/pdf-to-excel.css
/* Theme: Emerald/Green
/* ================================== */

/* Preview Container Scrolling */
#excelPagePreview {
    display: grid;
    place-items: start center; 
    overflow: auto;
}

#excelPagePreview canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: auto; 
}

/* Gradient Input (Green) */
.input-gradient-wrap {
    padding: 2px;
    border-radius: 0.6rem;
    background: linear-gradient(to bottom right, #10b981, #16a34a);
    transition: all 0.3s ease;
}
.input-gradient-wrap:focus-within {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.input-gradient-wrap input {
    width: 100%;
    border: none !important;
    outline: none !important;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-primary); 
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}
body.dark .input-gradient-wrap input {
     background-color: var(--bg-secondary-hover);
}

/* === SPREADSHEET TABLE STYLES (IMPROVED) === */
.excel-preview-table {
    border-collapse: separate; /* Better for sticky headers */
    border-spacing: 0;
    width: 100%;
    font-family: 'Calibri', 'Arial', sans-serif;
    font-size: 13px;
    background-color: white;
    color: #000;
}

.excel-preview-table th, 
.excel-preview-table td {
    border: 1px solid #d1d5db;
    padding: 6px 10px; /* Increased padding */
    min-width: 80px; /* Slightly wider default */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Improved Header Row */
.excel-preview-table tr:first-child td {
    background-color: #ecfdf5; /* Light green tint */
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid #10b981;
    position: sticky;
    top: 0;
    z-index: 20;
}

/* Row Numbers (First Column) */
.excel-preview-table td:first-child {
    background-color: #f3f4f6;
    font-weight: bold;
    color: #6b7280;
    text-align: center;
    width: 40px;
    min-width: 40px;
    user-select: none;
    position: sticky;
    left: 0;
    z-index: 15;
    border-right: 2px solid #d1d5db;
}

/* Zebra Striping */
.excel-preview-table tr:nth-child(even) td:not(:first-child) {
    background-color: #fafafa;
}

.excel-preview-table td[contenteditable="true"]:focus {
    outline: 2px solid #10b981;
    background-color: #fff;
    z-index: 10;
    position: relative;
}

/* Dark Mode Table Overrides */
body.dark .excel-preview-table {
    background-color: #1f2937;
    color: #e5e7eb;
}
body.dark .excel-preview-table th, 
body.dark .excel-preview-table td {
    border-color: #4b5563;
}
body.dark .excel-preview-table tr:first-child td {
    background-color: #064e3b; /* Dark Green */
    color: white;
}
body.dark .excel-preview-table td:first-child {
    background-color: #111827;
    color: #9ca3af;
    border-right-color: #4b5563;
}
body.dark .excel-preview-table tr:nth-child(even) td:not(:first-child) {
    background-color: #374151;
}
body.dark .excel-preview-table td[contenteditable="true"]:focus {
    background-color: #065f46;
}