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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Upload Section */
.upload-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f8fafc;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #667eea;
    background: #eef2ff;
    transform: translateY(-2px);
}

.drop-zone-content h2 {
    font-size: 1.5rem;
    margin: 15px 0 10px;
    color: #2d3748;
}

.drop-zone-content p {
    color: #718096;
    margin-bottom: 20px;
}

.upload-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.upload-features span {
    font-size: 0.9rem;
    color: #48bb78;
    font-weight: 500;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.select-files-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-files-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* File List Section */
.file-list-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h3 {
    font-size: 1.3rem;
    color: #2d3748;
}

.action-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-controls label {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.sort-select {
    padding: 6px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    color: #2d3748;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-select:hover {
    border-color: #3182ce;
}

.sort-select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.btn-primary {
    background: #48bb78;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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

/* File List */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.file-icon {
    font-size: 1.5rem;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    font-weight: 600;
    color: #2d3748;
    word-break: break-word;
}

.file-date {
    font-size: 0.9rem;
    color: #718096;
}

.file-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.invoice-display {
    font-size: 0.9rem;
    color: #3182ce;
    font-weight: 500;
    white-space: nowrap;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 140px;
}

.remove-btn {
    background: #fed7d7;
    color: #c53030;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #feb2b2;
}

/* Status Section */
.status-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.status-text {
    text-align: center;
    color: #4a5568;
    font-weight: 500;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
}

.toast.success {
    background: #48bb78;
}

.toast.error {
    background: #f56565;
}

.toast.warning {
    background: #ed8936;
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .drop-zone {
        padding: 40px 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .file-item {
        grid-template-columns: auto 1fr;
        gap: 10px;
    }
    
    .file-item .file-controls,
    .file-item .remove-btn {
        grid-column: 1 / -1;
        justify-self: start;
        width: auto;
    }

    .file-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .toast-container {
        left: 15px;
        right: 15px;
        top: 15px;
    }
}

@media (max-width: 480px) {
    .upload-section {
        padding: 25px 15px;
    }

    .file-list-section {
        padding: 20px 15px;
    }

    .file-name {
        font-size: 0.9rem;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .drop-zone-content h2 {
        font-size: 1.2rem;
    }

    .drop-zone-content p {
        font-size: 0.9rem;
    }
}

/* Additional utility classes */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.file-item.processing {
    background: #fff3cd;
    border-color: #ffeaa7;
}

.file-item.error {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.file-item.success {
    background: #d1edff;
    border-color: #bee5eb;
}

/* Footer */
.footer {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-content p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links span {
    font-size: 0.8rem;
    color: #4a5568;
    font-weight: 500;
}
