:root {
    --primary-blue: #2196F3;
    --success-green: #4CAF50;
    --warning-amber: #FFC107;
    --error-red: #F44336;
    --accent-purple: #9C27B0;
    --background: #f8f9fa;
    --surface: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border: #e0e0e0;
    --shadow: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 80px;
}

header {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

main {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.section.active {
    display: block;
}

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

.upload-section {
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed var(--primary-blue);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: var(--surface);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.upload-area:hover {
    border-color: var(--accent-purple);
    background: #f3f8ff;
}

.upload-area.dragover {
    border-color: var(--success-green);
    background: #f0fff4;
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.upload-area p {
    margin: 0.5rem 0;
    font-weight: 500;
}

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

.file-info {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border-left: 4px solid var(--success-green);
    box-shadow: 0 2px 8px var(--shadow);
}

.hidden {
    display: none !important;
}

.status-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 12px var(--shadow);
}

.status-balanced {
    border-left: 4px solid var(--success-green);
}

.status-unbalanced {
    border-left: 4px solid var(--error-red);
}

.status-warning {
    border-left: 4px solid var(--warning-amber);
}

.table-container {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    margin: 1rem 0;
}

.accounts-table {
    width: 100%;
    border-collapse: collapse;
}

.accounts-table th,
.accounts-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.accounts-table th {
    background: var(--primary-blue);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.accounts-table td {
    font-size: 0.85rem;
}

.account-error {
    background-color: rgba(244, 67, 54, 0.1);
}

.account-warning {
    background-color: rgba(255, 193, 7, 0.1);
}

.errors-container {
    margin: 1rem 0;
}

.error-item {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    border-left: 4px solid var(--error-red);
    box-shadow: 0 2px 8px var(--shadow);
}

.warning-item {
    border-left-color: var(--warning-amber);
}

.suggestions-section {
    margin: 2rem 0;
}

.suggestions-list {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px var(--shadow);
}

.suggestion-item {
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    background: rgba(76, 175, 80, 0.1);
    border-left: 4px solid var(--success-green);
}

.export-section {
    text-align: center;
    margin: 2rem 0;
}

.export-btn {
    background: linear-gradient(135deg, var(--success-green), #45a049);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.4);
}

.export-btn i {
    margin-right: 0.5rem;
}

.history-list {
    margin: 1rem 0;
}

.history-item {
    background: var(--surface);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.5rem 0;
    box-shadow: 0 2px 8px var(--shadow);
    border-left: 4px solid var(--primary-blue);
}

.history-item h4 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.history-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.25rem 0;
}

.clear-btn {
    background: var(--error-red);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #d32f2f;
}

.help-content {
    margin: 1rem 0;
}

.help-card {
    background: var(--surface);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 12px var(--shadow);
}

.help-card h3 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
}

.help-card ul,
.help-card ol {
    margin-left: 1.5rem;
}

.help-card li {
    margin: 0.5rem 0;
}

.faq-section {
    margin: 2rem 0;
}

.faq-container {
    margin: 1rem 0;
}

.faq-item {
    background: var(--surface);
    border-radius: 8px;
    margin: 0.5rem 0;
    box-shadow: 0 2px 8px var(--shadow);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: rgba(33, 150, 243, 0.05);
}

.faq-icon {
    font-size: 1.2rem;
    color: var(--primary-blue);
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 1rem 1rem;
    color: var(--text-secondary);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-answer.show {
    max-height: 200px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 10px var(--shadow);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 80px;
}

.nav-item.active {
    color: var(--primary-blue);
    background: rgba(33, 150, 243, 0.1);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

footer {
    background: var(--text-primary);
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
    margin-top: 2rem;
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(33, 150, 243, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-blue);
    animation: spin 1s ease-in-out infinite;
}

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

@media (min-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 2rem;
    }
    
    .upload-area {
        padding: 3rem;
    }
    
    .accounts-table th,
    .accounts-table td {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .bottom-nav {
        position: relative;
        background: transparent;
        border: none;
        box-shadow: none;
        justify-content: center;
        gap: 2rem;
        padding: 2rem 0;
    }
    
    .nav-item {
        flex: none;
        max-width: none;
        padding: 1rem 2rem;
        background: var(--surface);
        box-shadow: 0 2px 8px var(--shadow);
        border-radius: 12px;
    }
    
    body {
        padding-bottom: 0;
    }
}

@media (min-width: 1024px) {
    .accounts-table {
        font-size: 1.1rem;
    }
    
    .upload-icon {
        font-size: 4rem;
    }
}
