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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.95;
}

.content {
    flex: 1;
    padding: 40px;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

/* Upload Tabs */
.upload-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tab-button:hover {
    border-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f1ff;
}

.upload-area.drag-over {
    border-color: #764ba2;
    background: #e8eaff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.upload-area p {
    color: #555;
    margin: 10px 0;
    font-size: 1em;
}

.or-text {
    color: #999;
    font-size: 0.9em !important;
}

#single-file-input,
#batch-file-input {
    display: none;
}

.file-button {
    display: inline-block;
    padding: 10px 25px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin-top: 10px;
}

.file-button:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

/* Status Messages */
.status-message {
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: 500;
}

.status-message.info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
}

.status-message.success {
    background: #e8f5e9;
    color: #388e3c;
    border-left: 4px solid #388e3c;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    border-left: 4px solid #c62828;
    font-weight: 500;
}

/* Results Section */
#results-section {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats */
.stats-box {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    flex: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
}

.transactions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.transactions-table thead {
    background: #f5f5f5;
}

.transactions-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.transactions-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.transactions-table tbody tr:hover {
    background: #f9f9f9;
}

.category-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
}

.category-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* Footer */
.footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
    border-top: 1px solid #eee;
    margin-top: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    .stats-box {
        flex-direction: column;
    }

    .upload-area {
        padding: 30px 20px;
    }

    .transactions-table {
        font-size: 0.85em;
    }

    .transactions-table th,
    .transactions-table td {
        padding: 10px 8px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        min-height: calc(100vh - 20px);
    }

    .content {
        padding: 15px;
    }

    .header {
        padding: 20px 15px;
    }

    .header h1 {
        font-size: 1.5em;
    }

    .section {
        margin-bottom: 20px;
    }

    .upload-area {
        padding: 20px;
    }

    .upload-icon {
        font-size: 2em;
    }
}
