/* Excel Reader Styles */

/* Tool container — same as all other tools */
.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 2rem) 2rem 4rem;
}

/* Back link — same as all other tools */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--accent-indigo);
    transform: translateX(-4px);
}

.back-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transform: rotate(180deg);
}

.tool-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.tool-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    min-width: 0; /* prevent grid overflow */
}

/* Right panel (preview) - ensure it doesn't overflow the container */
#panel-preview {
    overflow: hidden;
}

@media (max-width: 992px) {
    .tool-grid-layout { grid-template-columns: 1fr; }
}

/* Dropzone */
.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.06);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin: 0 auto 0.75rem;
    display: block;
}

.dropzone-title {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.dropzone-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
}

/* File info */
#file-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
}

/* Sheet tabs */
.sheet-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.sheet-tab {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
}

.sheet-tab:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.sheet-tab.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent-indigo);
    color: var(--accent-indigo);
    font-weight: 600;
}

/* Settings group */
.settings-group {
    margin-top: 1.25rem;
}

.settings-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* Filter */
.filter-row {
    margin-top: 0.5rem;
}

.filter-input-wrapper {
    position: relative;
}

.filter-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.6rem 0.75rem 0.6rem 2.2rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.25s ease;
}

.filter-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

/* Badge count */
.badge-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    margin-left: 0.5rem;
    white-space: nowrap;
}

/* Table */
.table-wrapper {
    margin-top: 0.75rem;
}

.table-scroll {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 60vh;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 100%;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

.data-table th {
    background: rgba(17, 25, 40, 0.98);
    color: #a5b4fc;
    font-weight: 700;
    padding: 0.7rem 0.8rem;
    text-align: left;
    border-bottom: 2px solid var(--accent-indigo);
    border-right: 1px solid rgba(99, 102, 241, 0.15);
    white-space: nowrap;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    position: sticky;
    top: 0;
    z-index: 3;
}

.data-table th:last-child {
    border-right: none;
}

.data-table td {
    padding: 0.5rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    max-width: 250px;
    min-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table td:last-child {
    border-right: none;
}

.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.06);
}

.data-table tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

/* Panel header */
.panel-header {
    margin-bottom: 1rem;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.panel-title svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* No image placeholder */
.no-image-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.no-image-placeholder p {
    font-size: 0.9rem;
}

/* Stat items */
.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-val {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Action buttons */
.panel-footer-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tool-container {
        padding: calc(var(--nav-height) + 1rem) 1rem 3rem !important;
    }
    .tool-page-header {
        margin-bottom: 1rem;
    }
    .tool-page-header .back-link {
        margin-bottom: 0.75rem;
    }
    .tool-page-header h1 {
        font-size: 1.35rem;
    }
    .tool-page-header p {
        font-size: 0.82rem;
    }
    .tool-panel {
        padding: 1rem !important;
    }
    .dropzone {
        padding: 1.5rem 1rem;
    }
    .panel-footer-actions {
        flex-direction: column !important;
        width: 100%;
    }
    .btn {
        justify-content: center;
    }
    
    /* On mobile: keep table horizontally scrollable, don't wrap cells */
    .data-table {
        font-size: 0.72rem;
        min-width: max(100%, 500px);
        table-layout: auto;
    }
    .data-table th,
    .data-table td {
        padding: 0.35rem 0.5rem;
        white-space: nowrap;
        max-width: none;
        min-width: auto;
    }
    .table-scroll {
        max-height: 50vh;
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}
