:root {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success-color: #10b981;
    --error-color: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 3rem 1rem;
    position: relative;
    overflow-x: hidden;
}

/* Background animated blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* Main Container */
.container {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Dropzone */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.4);
    position: relative;
    overflow: hidden;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    pointer-events: none;
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.drop-zone:hover .upload-icon {
    transform: translateY(-5px);
}

.drop-zone-text {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-main);
}

#file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Results Section */
.results-container {
    margin-top: 3rem;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.results-container.hidden {
    display: none;
    opacity: 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

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

.filters label {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.filter-select {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--primary-color);
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.primary-btn:active {
    transform: translateY(0);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
}

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

th, td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

th {
    background: rgba(30, 41, 59, 0.8);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

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

.amount {
    font-family: monospace;
    font-size: 0.85rem;
}

.amount.positive {
    color: var(--success-color);
}

.amount.negative {
    color: var(--text-main);
}

select.category-select {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.4rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.75rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

select.category-select:focus {
    border-color: var(--primary-color);
}

.lists-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.list-wrapper {
    min-width: 0;
}

.full-width-list-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--glass-border);
}

.list-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.list-wrapper h3 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 900px) {
    .lists-container {
        grid-template-columns: 1fr;
    }
}

.source-badge {
    display: inline-block;
    padding: 0.15rem 0.3rem;
    font-size: 0.65rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.uncategorized-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--glass-border);
}

.uncategorized-container h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.uncategorized-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.uncategorized-list li {
    background: rgba(15, 23, 42, 0.6);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    font-size: 0.85rem;
}

.uncategorized-count {
    background: var(--primary-color);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}
