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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #4A5FBD 0%, #5FBEAA 100%);
    min-height: 100vh;
    color: #2C3E50;
}

/* Top Navigation */
.top-nav {
    background: #FFFFFF;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 50px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #2C3E50;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #4A5FBD;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2C3E50;
}

/* Container */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Connection Section */
.connection-section {
    margin-bottom: 2rem;
}

.connection-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.drive-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.connection-card h2 {
    font-size: 2rem;
    color: #2C3E50;
    margin-bottom: 1rem;
}

.connection-card p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.connect-btn {
    background: linear-gradient(135deg, #4A5FBD 0%, #5FBEAA 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(74, 95, 189, 0.3);
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 95, 189, 0.4);
}

.connection-status {
    margin-top: 2rem;
    padding: 1rem;
    background: #D4EDDA;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-icon {
    color: #155724;
    font-size: 1.5rem;
    font-weight: bold;
}

.status-text {
    color: #155724;
    font-weight: 600;
}

.disconnect-btn {
    background: transparent;
    border: 2px solid #FF6B5A;
    color: #FF6B5A;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.disconnect-btn:hover {
    background: #FF6B5A;
    color: white;
}

/* Upload Section */
.upload-section {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #F8F9FA;
}

.upload-area:hover,
.upload-area.dragover {
    background: #E8E9EA;
    border-color: #4A5FBD;
    transform: scale(1.01);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #667eea;
}

.upload-area h2 {
    font-size: 1.5rem;
    color: #2C3E50;
    margin-bottom: 0.5rem;
}

.upload-area p {
    color: #666;
    margin-bottom: 1.5rem;
}

.browse-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Receipts List */
.receipts-list {
    margin-top: 2rem;
}

.receipt-item {
    background: #F8F9FA;
    border: 2px solid #E8E9EA;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.receipt-item:hover {
    border-color: #4A5FBD;
    box-shadow: 0 3px 10px rgba(74, 95, 189, 0.1);
}

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

.receipt-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.receipt-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #E8E9EA;
}

.file-icon {
    width: 60px;
    height: 60px;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 2rem;
}

.receipt-info h3 {
    font-size: 1.1rem;
    color: #2C3E50;
    margin-bottom: 0.3rem;
}

.receipt-info p {
    color: #666;
    font-size: 0.9rem;
}

.receipt-status {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.receipt-status.processing {
    background: #FFF3CD;
    color: #856404;
}

.receipt-status.ready {
    background: #D4EDDA;
    color: #155724;
}

.receipt-status.error {
    background: #F8D7DA;
    color: #721C24;
}

.receipt-details {
    margin-bottom: 1rem;
}

.detail-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.detail-item {
    flex: 1;
    min-width: 200px;
}

.detail-item label {
    display: block;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.detail-item span {
    color: #666;
}

.filename-edit {
    margin-bottom: 1rem;
}

.filename-edit label {
    display: block;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 0.5rem;
}

.filename-edit input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #E8E9EA;
    border-radius: 8px;
    font-size: 1rem;
    font-family: monospace;
    transition: border-color 0.3s ease;
}

.filename-edit input:focus {
    outline: none;
    border-color: #4A5FBD;
}

.receipt-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.upload-btn, .remove-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.upload-btn {
    background: #4A5FBD;
    color: white;
}

.upload-btn:hover:not(:disabled) {
    background: #3A4F9D;
    transform: translateY(-1px);
}

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

.remove-btn {
    background: transparent;
    border: 2px solid #FF6B5A;
    color: #FF6B5A;
}

.remove-btn:hover {
    background: #FF6B5A;
    color: white;
}

/* Processing Section */
.processing-section {
    background: white;
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #4A5FBD;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-section p {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.progress-bar {
    width: 100%;
    max-width: 400px;
    height: 10px;
    background: #E8E9EA;
    border-radius: 5px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4A5FBD 0%, #5FBEAA 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* Error Section */
.error-section {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.error-message {
    color: #721C24;
    background: #F8D7DA;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.retry-btn {
    background: linear-gradient(135deg, #FF6B5A 0%, #FF5544 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 90, 0.4);
}

/* Footer */
footer {
    text-align: center;
    color: white;
    padding: 2rem 0;
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .receipt-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .receipt-actions {
        width: 100%;
        justify-content: stretch;
    }

    .upload-btn, .remove-btn {
        flex: 1;
    }
}
