/* Excel Spreadsheet Styling */

.excel-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f3f2f1;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Start Screen */
.excel-start-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(135deg, #217346 0%, #1a5c38 100%);
}

.excel-start-header {
    padding: 24px 32px;
}

.excel-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
}

.excel-logo-icon {
    font-size: 32px;
}

.excel-logo-text {
    font-size: 28px;
    font-weight: 300;
}

.excel-start-content {
    flex: 1;
    display: flex;
    background: white;
    border-top-left-radius: 8px;
    overflow: hidden;
}

.excel-start-section {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.excel-start-section h3,
.excel-start-sidebar h3 {
    margin: 0 0 16px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.excel-start-sidebar {
    width: 280px;
    padding: 24px;
    background: #f8f8f8;
    border-left: 1px solid #e1e1e1;
}

/* File List */
.excel-file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.excel-file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.excel-file-item:hover {
    background: #e8f5e9;
}

.excel-file-icon {
    font-size: 32px;
}

.excel-file-info {
    flex: 1;
}

.excel-file-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.excel-file-meta {
    font-size: 12px;
    color: #666;
}

/* Templates */
.excel-template-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.excel-template {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}

.excel-template:hover:not(.disabled) {
    border-color: #217346;
    background: #e8f5e9;
}

.excel-template.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.excel-template-icon {
    font-size: 24px;
}

.excel-start-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: #fff3cd;
    border-radius: 4px;
    font-size: 12px;
    color: #856404;
    line-height: 1.5;
}

.hint-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* Toolbar */
.excel-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    background: #f8f8f8;
    border-bottom: 1px solid #d1d1d1;
}

.excel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}

.excel-btn:hover:not(:disabled) {
    background: #e5e5e5;
    border-color: #c1c1c1;
}

.excel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.excel-toolbar-separator {
    width: 1px;
    height: 20px;
    background: #d1d1d1;
    margin: 0 4px;
}

.excel-cell-ref {
    min-width: 50px;
    padding: 4px 8px;
    background: white;
    border: 1px solid #d1d1d1;
    font-size: 12px;
    font-family: 'Consolas', monospace;
    text-align: center;
}

.excel-formula-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.excel-formula-bar .fx {
    font-style: italic;
    font-size: 12px;
    color: #666;
    padding: 0 8px;
}

.excel-formula-bar input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #d1d1d1;
    font-size: 12px;
    font-family: 'Consolas', monospace;
}

.excel-formula-bar input:disabled {
    background: #f5f5f5;
}

/* Spreadsheet */
.excel-spreadsheet-container {
    flex: 1;
    overflow: auto;
    background: #e8e8e8;
}

.excel-spreadsheet {
    border-collapse: collapse;
    background: white;
    font-size: 12px;
    min-width: 100%;
}

.excel-col-header {
    background: #f0f0f0;
    border: 1px solid #c0c0c0;
    padding: 4px 8px;
    font-weight: normal;
    color: #333;
    text-align: center;
    min-width: 80px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.excel-row-header {
    background: #f0f0f0;
    border: 1px solid #c0c0c0;
    padding: 4px 8px;
    font-weight: normal;
    color: #333;
    text-align: center;
    min-width: 40px;
    position: sticky;
    left: 0;
    z-index: 1;
}

.excel-cell {
    border: 1px solid #d4d4d4;
    padding: 4px 8px;
    min-width: 100px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: cell;
    transition: background 0.1s ease;
}

.excel-cell:hover {
    background: #e8f5e9;
}

.excel-cell.selected {
    background: #c8e6c9;
    outline: 2px solid #217346;
    outline-offset: -1px;
}

.excel-cell.excel-header-cell {
    background: #e8e8e8;
    font-weight: 600;
    color: #333;
}

.excel-cell.excel-number {
    text-align: right;
    font-family: 'Consolas', monospace;
}

.excel-cell.excel-negative {
    color: #c62828;
}

.excel-cell.excel-empty {
    color: #999;
}

/* Sheet Bar */
.excel-sheet-bar {
    display: flex;
    align-items: center;
    background: #e8e8e8;
    border-top: 1px solid #c0c0c0;
    padding: 0 4px;
}

.excel-sheet-tabs {
    display: flex;
    gap: 2px;
}

.excel-sheet-tab {
    padding: 6px 16px;
    background: #d4d4d4;
    border: 1px solid #c0c0c0;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.excel-sheet-tab:hover {
    background: #e0e0e0;
}

.excel-sheet-tab.active {
    background: white;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
}

.excel-sheet-add {
    padding: 6px 12px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.excel-sheet-add.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Status Bar */
.excel-statusbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 12px;
    background: #217346;
    color: white;
    font-size: 11px;
}

.excel-status-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.excel-zoom {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Scrollbar Styling */
.excel-spreadsheet-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.excel-spreadsheet-container::-webkit-scrollbar-track {
    background: #f0f0f0;
}

.excel-spreadsheet-container::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 6px;
    border: 2px solid #f0f0f0;
}

.excel-spreadsheet-container::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

/* Responsive */
@media (max-width: 700px) {
    .excel-start-content {
        flex-direction: column;
    }

    .excel-start-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e1e1e1;
    }
}
