@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overscroll-behavior: none;
    background: #00120d;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #00120d 0%, #001510 30%, #001f1a 60%, #002d24 80%, #00120d 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-y: auto;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 800px 600px at 50% 10%, rgba(16, 185, 129, 0.12) 0%, transparent 50%),
        radial-gradient(circle 600px at 15% 20%, rgba(6, 78, 59, 0.18) 0%, transparent 60%),
        radial-gradient(circle 500px at 85% 30%, rgba(4, 120, 87, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.app {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    padding-top: 80px;
    padding-bottom: 3rem;
}

.page-header {
    padding: 3rem 2rem 2rem 2rem;
}

.page-header-container {
    max-width: 1400px;
    margin: 0 auto;
}

.page-title {
    font-family: 'DM Serif Display', serif;
    font-size: 3rem;
    font-weight: 400;
    color: #ffffff;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.page-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.filters-section {
    background: linear-gradient(135deg, rgba(6, 30, 23, 0.5) 0%, rgba(4, 47, 46, 0.7) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    padding: 2rem 2rem;
    margin: 0 auto;
    width: 100%;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.filter-group input, .filter-group select {
    padding: 0.625rem 0.75rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.filter-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.filter-group select option {
    background: #001510;
    color: #ffffff;
}

.filter-group input:focus, .filter-group select:focus {
    outline: none;
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.filter-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.5rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.filter-buttons {
    display: flex;
    gap: 0.75rem;
}

.btn {
    padding: 0.625rem 1.25rem;
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: rgba(16, 185, 129, 0.2);
    color: #ffffff;
    border-color: rgba(16, 185, 129, 0.5);
}

.btn-primary:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.3);
    border-color: rgba(16, 185, 129, 0.7);
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
}

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

.view-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.view-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    color: #ffffff;
}

.view-toggle.active {
    background: rgba(16, 185, 129, 0.2);
    color: #ffffff;
    border-color: rgba(16, 185, 129, 0.5);
}

.view-toggle:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

.spreadsheet-container {
    flex: 1;
    background: rgba(0, 18, 13, 0.6);
    backdrop-filter: blur(20px);
    margin: 2rem auto;
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: calc(100% - 4rem);
    max-width: 1400px;
}

.virtual-table {
    flex: 1;
    position: relative;
    overflow: auto;
    border: none;
}

.table-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, rgba(6, 30, 23, 0.95) 0%, rgba(4, 47, 46, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(16, 185, 129, 0.4);
    z-index: 10;
    display: flex;
    font-weight: 700;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Inter', sans-serif;
    width: 100%;
}

.table-body {
    font-size: 0.75rem;
    font-family: 'Inter', sans-serif;
}

/* Smaller font for complete view */
.view-complete .table-body {
    font-size: 0.45rem;
}

.view-complete .table-header {
    font-size: 0.5rem;
}

.table-row {
    display: flex;
    border-bottom: 1px solid rgba(16, 185, 129, 0.15);
    transition: background-color 0.15s;
    width: 100%;
}

.table-row:hover {
    background: rgba(16, 185, 129, 0.08);
}

.table-row:nth-child(even) {
    background: rgba(0, 0, 0, 0.2);
}

.table-row:nth-child(odd) {
    background: rgba(0, 0, 0, 0.3);
}

.table-cell {
    padding: 0.5rem 0.6rem;
    border-right: 1px solid rgba(16, 185, 129, 0.15);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    min-height: 2.5rem;
    color: rgba(255, 255, 255, 0.85);
}

.table-header .table-cell {
    background: transparent;
    font-weight: 700;
    border-bottom: none;
    position: relative;
    overflow: hidden;
    resize: none;
    cursor: pointer;
    transition: background-color 0.2s;
    color: rgba(255, 255, 255, 0.95);
}

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    cursor: col-resize;
    z-index: 20;
}

.resize-handle:hover {
    background: rgba(16, 185, 129, 0.5);
}

.resizing {
    user-select: none;
}

.table-header .table-cell:hover {
    background: rgba(16, 185, 129, 0.1);
}

.table-header .table-cell.sortable:hover {
    background: rgba(16, 185, 129, 0.15);
}

.sort-indicator {
    margin-left: 0.3rem;
    font-size: 0.7rem;
    color: #10b981;
}

.sortable.sort-asc .resize-handle,
.sortable.sort-desc .resize-handle {
    display: none;
}

/* Column widths */
.col-id { width: 100px; }
.col-owner { width: 200px; }
.col-city { width: 140px; }
.col-zip { width: 70px; }
.col-holder { width: 260px; }
.col-type { width: 190px; }
.col-balance {
    width: 70px;
    text-align: right;
    flex-grow: 1;
    min-width: 70px;
}

/* Additional columns for complete view */
.col-owner-addr1 { width: 220px; }
.col-owner-addr2 { width: 95px; }
.col-owner-addr3 { width: 95px; }
.col-owner-state { width: 60px; }
.col-owner-country { width: 80px; }
.col-num-owners { width: 90px; text-align: center; }
.col-holder-addr1 { width: 200px; }
.col-holder-addr2 { width: 95px; }
.col-holder-addr3 { width: 95px; }
.col-holder-city { width: 100px; }
.col-holder-state { width: 60px; }
.col-holder-zip { width: 70px; }
.col-cash { width: 140px; text-align: right; }
.col-shares { width: 80px; text-align: right; }
.col-securities { width: 120px; }
.col-pending { width: 80px; text-align: center; }
.col-paid { width: 60px; text-align: center; }
.col-cusip { width: 80px; }

.amount {
    font-weight: 600;
    color: #10b981;
}

.claims-indicator {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-size: 0.7rem;
    font-weight: 600;
}

.claims-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.4);
}

.claims-paid {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.4);
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

.status-bar {
    background: linear-gradient(135deg, rgba(6, 30, 23, 0.8) 0%, rgba(4, 47, 46, 0.9) 100%);
    backdrop-filter: blur(20px);
    padding: 0.5rem 1rem;
    border-top: 1px solid rgba(16, 185, 129, 0.3);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid rgba(16, 185, 129, 0.4);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: #ffffff;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.15);
}

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

.page-btn.active {
    background: rgba(16, 185, 129, 0.2);
    color: #ffffff;
    border-color: rgba(16, 185, 129, 0.5);
}

#rows-per-page {
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 0.3rem;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

#rows-per-page option {
    background: #001510;
    color: #ffffff;
}

/* View-specific column hiding */
.view-essential .complete-only { display: none !important; }
.view-complete .complete-only { display: flex !important; }

/* Hide secondary columns by default in complete view */
.view-complete .secondary-column { display: none !important; }

/* Show secondary columns when explicitly enabled */
.view-complete.show-secondary .secondary-column { display: flex !important; }

/* Mobile Responsive Styles */
@media (max-width: 968px) {
    .app {
        padding-top: 70px;
        padding-bottom: 2rem;
    }

    .page-header {
        padding: 2rem 1.5rem 1.5rem 1.5rem;
    }

    .page-title {
        font-size: 2.25rem;
        margin-bottom: 0.65rem;
    }

    .page-description {
        font-size: 1rem;
    }

    .filters-section {
        padding: 1.5rem 1.5rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .filter-group label {
        font-size: 0.85rem;
    }

    .filter-group input, .filter-group select {
        padding: 0.6rem 0.7rem;
        font-size: 0.875rem;
    }

    .filter-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .filter-buttons {
        display: flex;
        flex-direction: column;
        gap: 0.65rem;
        width: 100%;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        width: 100%;
    }

    .view-controls {
        width: 100%;
        justify-content: space-between;
    }

    .view-toggle {
        padding: 0.6rem 1rem;
        font-size: 0.875rem;
        flex: 1;
    }

    .spreadsheet-container {
        width: calc(100% - 2rem);
        margin: 1.5rem auto;
        border-radius: 8px;
    }

    .table-header {
        font-size: 0.7rem;
    }

    .table-body {
        font-size: 0.7rem;
    }

    .view-complete .table-body {
        font-size: 0.4rem;
    }

    .view-complete .table-header {
        font-size: 0.45rem;
    }

    .table-cell {
        padding: 0.45rem 0.5rem;
        min-height: 2rem;
        font-size: 0.7rem;
    }

    /* Adjusted column widths for mobile */
    .col-id { width: 80px; }
    .col-owner { width: 150px; }
    .col-city { width: 110px; }
    .col-zip { width: 60px; }
    .col-holder { width: 200px; }
    .col-type { width: 150px; }
    .col-balance { width: 60px; min-width: 60px; }

    .status-bar {
        padding: 0.45rem 0.75rem;
        font-size: 0.75rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .pagination-controls {
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    .page-btn {
        padding: 0.3rem 0.65rem;
        font-size: 0.75rem;
    }

    #rows-per-page {
        font-size: 0.75rem;
        padding: 0.25rem;
    }

    .claims-indicator {
        padding: 0.1rem 0.4rem;
        font-size: 0.65rem;
    }

    .sort-indicator {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .app {
        padding-top: 60px;
        padding-bottom: 1.5rem;
    }

    .page-header {
        padding: 1.5rem 1rem 1rem 1rem;
    }

    .page-title {
        font-size: 1.875rem;
        margin-bottom: 0.5rem;
    }

    .page-description {
        font-size: 0.925rem;
    }

    .filters-section {
        padding: 1.25rem 1rem;
    }

    .filters-grid {
        gap: 0.875rem;
        margin-bottom: 1rem;
    }

    .filter-group label {
        font-size: 0.8rem;
    }

    .filter-group input, .filter-group select {
        padding: 0.55rem 0.65rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .btn {
        padding: 0.55rem 0.875rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .view-toggle {
        padding: 0.55rem 0.875rem;
        font-size: 0.85rem;
        border-radius: 6px;
    }

    .spreadsheet-container {
        width: calc(100% - 1.5rem);
        margin: 1.25rem auto;
        border-radius: 6px;
    }

    .table-header {
        font-size: 0.65rem;
    }

    .table-body {
        font-size: 0.65rem;
    }

    .view-complete .table-body {
        font-size: 0.38rem;
    }

    .view-complete .table-header {
        font-size: 0.42rem;
    }

    .table-cell {
        padding: 0.4rem 0.45rem;
        min-height: 1.875rem;
        font-size: 0.65rem;
    }

    /* Further reduced column widths for small mobile */
    .col-id { width: 70px; }
    .col-owner { width: 130px; }
    .col-city { width: 100px; }
    .col-zip { width: 55px; }
    .col-holder { width: 180px; }
    .col-type { width: 130px; }
    .col-balance { width: 55px; min-width: 55px; }

    .status-bar {
        padding: 0.4rem 0.65rem;
        font-size: 0.7rem;
    }

    .pagination-controls {
        gap: 0.35rem;
    }

    .page-btn {
        padding: 0.25rem 0.55rem;
        font-size: 0.7rem;
        border-radius: 4px;
    }

    #rows-per-page {
        font-size: 0.7rem;
        padding: 0.2rem;
        border-radius: 4px;
    }

    .claims-indicator {
        padding: 0.1rem 0.35rem;
        font-size: 0.6rem;
        border-radius: 3px;
    }

    .amount {
        font-size: 0.65rem;
    }
}
