:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --row-hover: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.1) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

header {
    padding: 2rem 2.5rem 1.5rem;
    text-align: center;
}

header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header h1 abbr {
    cursor: help;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.search-controls {
    padding: 0 2.5rem 2rem;
}

.search-wrapper {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

#search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

#search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--text-muted);
    pointer-events: none;
}

.table-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
    padding: 0 1rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    position: sticky;
    top: 0;
    background: rgba(30, 41, 59, 1);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--glass-border);
    z-index: 10;
}

th.sortable {
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
}

th.sortable .header-content {
    display: flex;
    align-items: center;
}

th.sortable:hover {
    color: var(--text-main);
}

th.active {
    color: var(--primary);
}

.sort-icon {
    display: inline-block;
    width: 1rem;
    margin-left: 0.25rem;
    font-size: 1.2rem;
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
    color: var(--text-main);
}

tr {
    transition: background 0.2s;
}

tr:hover {
    background: var(--row-hover);
}

.track-id {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    width: 60px;
}

.track-name {
    font-weight: 500;
    color: #e2e8f0;
}

.duration-tag {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    padding: 0.25rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.launch-count {
    font-family: 'JetBrains Mono', monospace;
    color: #f59e0b;
}

.copy-btn {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.copy-btn.success {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

footer {
    padding: 1.5rem 2.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

button:disabled {
    background: #334155;
    color: #64748b;
    cursor: not-allowed;
}

#page-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.stats {
    font-size: 0.9rem;
    color: var(--text-muted);
}

#total-count {
    color: var(--text-main);
    font-weight: 600;
}

/* Loading Spinner */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

.empty-state {
    padding: 4rem;
    text-align: center;
    color: var(--text-muted);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}