/* CSS Variables */
:root {
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --success-start: #11998e;
    --success-end: #38ef7d;
    --bg-start: #1a1a2e;
    --bg-mid: #16213e;
    --bg-end: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --error: #ff4757;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-logout #username-display {
    font-weight: 600;
    color: var(--primary-start);
}

.header h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Card Component */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease;
}

.card-error {
    background: rgba(255, 71, 87, 0.1);
    border-color: var(--error);
}

/* Upload Zone */
.upload-zone {
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
}

.upload-zone:hover {
    border-color: var(--primary-start);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.upload-zone.drag-over {
    border-color: var(--success-start);
    background: rgba(17, 153, 142, 0.1);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.upload-zone h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.upload-zone p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.file-types {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 20px !important;
}

/* File Preview */
.file-preview {
    margin-top: 30px;
    animation: fadeIn 0.4s ease;
}

.file-preview h4 {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#file-list {
    list-style: none;
}

#file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

#file-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 15px;
}

.remove-file {
    background: rgba(255, 71, 87, 0.2);
    border: none;
    color: var(--error);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: var(--error);
    color: white;
    transform: rotate(90deg);
}

/* Form Fields */
.form-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-start);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-start);
    background: rgba(102, 126, 234, 0.1);
}

.btn-lg {
    width: 100%;
    padding: 18px 32px;
    font-size: 18px;
    margin-top: 20px;
}

/* Processing Section */
.processing {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 64px;
    height: 64px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-start);
    border-radius: 50%;
    margin: 0 auto 30px;
    animation: spin 1s linear infinite;
}

.processing h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

#processing-status {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--success-start), var(--success-end));
    width: 0;
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* Results Section */
.results-header {
    margin-bottom: 30px;
}

.success-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--success-start), var(--success-end));
    border-radius: 50px;
    font-weight: 600;
}

.success-badge .icon {
    font-size: 24px;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

#results-table {
    width: 100%;
    border-collapse: collapse;
}

#results-table thead {
    background: rgba(255, 255, 255, 0.05);
}

#results-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
}

#results-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

#results-table tbody tr {
    transition: all 0.3s ease;
}

#results-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

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

.amount {
    font-weight: 600;
    color: var(--success-start);
}

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.actions .btn {
    flex: 1;
    min-width: 200px;
}

/* Error Section */
.error-content {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
}

.error-content h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--error);
}

#error-message {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 16px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header h1 {
        font-size: 32px;
    }

    .subtitle {
        font-size: 16px;
    }

    .card {
        padding: 24px;
    }

    .upload-zone {
        padding: 40px 20px;
    }

    .upload-icon {
        font-size: 48px;
    }

    .form-fields {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .actions .btn {
        width: 100%;
        min-width: auto;
    }

    #results-table {
        font-size: 14px;
    }

    #results-table th,
    #results-table td {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 24px;
    }

    .logo {
        font-size: 22px;
    }

    .card {
        padding: 16px;
    }

    .upload-zone h3 {
        font-size: 20px;
    }

    .stat-value {
        font-size: 28px;
    }

    #results-table th,
    #results-table td {
        padding: 8px;
        font-size: 12px;
    }
}
