* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
}

.section {
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Login Section */
#login-section {
    text-align: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.login-header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.8em;
    font-weight: 700;
}

.app-subtitle {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-bottom: 40px;
    font-weight: 400;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 380px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.auth-form h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.3em;
}

.auth-form input {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.auth-note {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 15px;
    font-style: italic;
}

/* App Section */
header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.header-left h1 {
    color: #2c3e50;
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 5px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

#user-email {
    color: #6c757d;
    font-size: 0.9em;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 15px;
}

.logout-btn {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Folder Selector */
.folder-selector {
    text-align: center;
    margin-bottom: 30px;
}

.folder-selector h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 600;
}

.instruction {
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 1em;
    line-height: 1.5;
}

.security-notice {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    font-size: 0.95em;
    color: #2e7d32;
}

.file-input-container {
    margin: 25px 0;
}

.file-input-label {
    display: inline-block;
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.file-input-label:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

#folder-input {
    display: none;
}

.process-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.process-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.process-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* File Info */
.file-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 8px;
    margin: 20px 0;
}

.file-info-content {
    padding: 15px;
    text-align: center;
    font-size: 1em;
    color: #1565c0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.file-icon {
    font-size: 1.2em;
}

/* Results */
.results {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #e9ecef;
}

.results-header {
    text-align: center;
    margin-bottom: 25px;
}

.results-header h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 600;
}

.results-summary {
    font-size: 1.1em;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 400px;
}

.order-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    margin-bottom: 20px;
}

.order-item {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.order-item:hover {
    background-color: #f8f9fa;
}

.order-item:last-child {
    border-bottom: none;
}

.order-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1em;
}

.file-name {
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 5px;
}

.export-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #6c5ce7 0%, #5b4cd1 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.btn-text {
    flex: 1;
}

.btn-icon {
    font-size: 1.1em;
}

/* Loading */
.loading {
    text-align: center;
    padding: 50px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.footer-content {
    text-align: center;
    color: #6c757d;
    font-size: 0.9em;
}

.footer-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .section {
        padding: 20px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .user-info {
        align-items: center;
    }
    
    .auth-form {
        padding: 30px 20px;
    }
    
    .login-header h1,
    .header-left h1 {
        font-size: 2.2em;
    }
}