:root {
    --bg-color: #0d1117;
    --bg-color-alt: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --accent-hover: #79c0ff;
    --border: #30363d;
    --glass-bg: rgba(22, 27, 34, 0.7);
    --glass-border: rgba(48, 54, 61, 0.5);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}

/* Background Shapes for Glassmorphism */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.bg-shape {
    position: absolute;
    filter: blur(140px);
    border-radius: 50%;
    opacity: 0.6;
    animation: drift 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.shape-1 {
    top: -10%;
    right: -5%;
    width: 50vw;
    height: 50vw;
    max-width: 800px;
    max-height: 800px;
    background: #58a6ff;
}

.shape-2 {
    bottom: -10%;
    left: -5%;
    width: 40vw;
    height: 40vw;
    max-width: 700px;
    max-height: 700px;
    background: #8a2be2;
    animation-delay: -10s;
}

@keyframes drift {
    100% {
        transform: translate(50px, -50px) scale(1.1);
    }
}

/* Hero Section */
.hero {
    position: relative;
    padding: 80px 0 60px;
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.3);
    margin-bottom: 24px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--accent), #a371f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Search Box */
.search-box {
    max-width: 800px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 8px;
    display: flex;
    gap: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px inset rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: rgba(88, 166, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px inset rgba(88, 166, 255, 0.2);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.search-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

#searchInput {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    padding: 8px 16px;
}

input[type="text"]:focus {
    outline: none;
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Custom Select */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    min-width: 250px;
    z-index: 100;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select-trigger {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 16px 40px 16px 20px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.custom-select-trigger::after {
    content: '';
    position: absolute;
    right: 16px;
    width: 10px;
    height: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s;
}

.custom-select.open .custom-select-trigger::after {
    transform: rotate(180deg);
}

.custom-select.open .custom-select-trigger {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

.custom-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color-alt);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.custom-option {
    display: block;
    padding: 14px 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.custom-option:hover {
    background: rgba(88, 166, 255, 0.1);
    color: var(--text-primary);
    padding-left: 24px;
}

.custom-option.selected {
    color: var(--text-primary);
    background: rgba(88, 166, 255, 0.05);
    font-weight: 600;
    border-left-color: var(--accent);
}

/* Loaders and Status */
.loading-status {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 40px;
    opacity: 0;
    transition: opacity 0.3s;
}

.loading-status.active {
    opacity: 1;
}

.loading-status .msg-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(88, 166, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

#loadingMessage {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Progress Bar */
.progress-container {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease-out;
}

/* Results Section */
.content {
    padding-bottom: 80px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
}

.results-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.results-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 100px;
}

/* Table Design */
.table-container {
    background: var(--bg-color-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

th {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.02);
    white-space: nowrap;
    vertical-align: top;
}

.column-filter {
    margin-top: 8px;
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 6px 0;
    /* Removed horizontal padding as requested */
    text-indent: 4px;
    /* Optional slight indent for text readability instead of padding */
    font-size: 0.8rem;
    outline: none;
    transition: var(--transition);
}

.column-filter:focus {
    border-color: var(--accent);
}

/* Custom Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color-alt);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    max-height: 200px;
    overflow-y: auto;
    z-index: 999;
}

.autocomplete-option {
    padding: 8px 10px;
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    font-weight: normal;
    text-transform: none;
    white-space: normal;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.autocomplete-option:last-child {
    border-bottom: none;
}

.autocomplete-option:hover {
    background: rgba(88, 166, 255, 0.15);
}

/* Pagination specifics */
#currentPageText {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    font-weight: bold;
    color: var(--accent);
}

#currentPageText:hover {
    background: rgba(255, 255, 255, 0.1);
}

#currentPageInput {
    width: 60px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    padding: 2px 4px;
    outline: none;
}

/* Remove Arrows from Input Number */
#currentPageInput::-webkit-outer-spin-button,
#currentPageInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#currentPageInput {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Pagination Buttons Styling */
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(88, 166, 255, 0.15);
    border-color: var(--accent);
    transform: translateY(-1px);
}

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

/* Flatpickr Custom Accents */
.flatpickr-calendar {
    background: var(--bg-color-alt) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    padding-bottom: 5px;
}

.flatpickr-month {
    background: transparent !important;
}

.flatpickr-months {
    background: transparent !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid var(--glass-border);
}

.flatpickr-current-month {
    padding-top: 4px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month .custom-year-select {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 4px 24px 4px 8px !important;
    outline: none !important;
    appearance: none !important;
    -moz-appearance: none !important;
    -webkit-appearance: none !important;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary) !important;
    transition: var(--transition);
    height: 32px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 6px center !important;
    background-size: 14px !important;
    margin: 0 4px;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover,
.flatpickr-current-month .custom-year-select:hover {
    border-color: var(--accent) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months option,
.flatpickr-current-month .custom-year-select option {
    background: var(--bg-color-alt) !important;
    color: var(--text-primary) !important;
}

.flatpickr-current-month .numInputWrapper {
    display: none !important;
}

.flatpickr-prev-month,
.flatpickr-next-month {
    fill: var(--text-primary) !important;
    color: var(--text-primary) !important;
    padding: 16px 10px 10px !important;
    /* Added more top padding to center them with the tall dropdowns */
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
    fill: var(--accent) !important;
}

span.flatpickr-weekday {
    color: var(--text-secondary) !important;
    font-weight: 600 !important;
    background: rgba(0, 0, 0, 0.2) !important;
    padding: 10px 0 !important;
}

.flatpickr-day {
    border: none !important;
    box-shadow: none !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-primary) !important;
    margin-top: 2px !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.flatpickr-day.inRange {
    background: rgba(88, 166, 255, 0.15) !important;
    border-color: transparent !important;
    box-shadow: -5px 0 0 rgba(88, 166, 255, 0.15), 5px 0 0 rgba(88, 166, 255, 0.15) !important;
    border-radius: 0 !important;
}

.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: rgba(88, 166, 255, 0.25) !important;
}

td {
    font-size: 0.95rem;
    color: var(--text-primary);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive Table scroll */
.table-container {
    overflow-x: auto;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Empty State */
.empty-state {
    display: none;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state.active {
    display: block;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
}

.btn-page {
    background: var(--bg-color-alt);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-page:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

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

.page-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Media Queries */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
        padding: 12px;
    }

    .search-input-wrapper {
        padding: 8px 12px;
    }

    .select-wrapper {
        min-width: 100%;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    th,
    td {
        padding: 12px 16px;
    }
}