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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.upload-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #4299e1;
    background-color: #f0f9ff;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: #cbd5e0;
}

.browse-btn {
    background-color: #4299e1;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
    transition: background-color 0.3s ease;
}

.browse-btn:hover {
    background-color: #3182ce;
}

.file-info {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: #f7fafc;
    border-radius: 8px;
    gap: 15px;
}

.file-icon {
    width: 24px;
    height: 24px;
    color: #4299e1;
}

.remove-btn {
    margin-left: auto;
    background-color: #e53e3e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

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

.form-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2d3748;
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #4299e1;
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

select.input-field {
    cursor: pointer;
}


.process-btn {
    width: 100%;
    background-color: #48bb78;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.process-btn:hover:not(:disabled) {
    background-color: #38a169;
}

.process-btn:disabled {
    background-color: #cbd5e0;
    cursor: not-allowed;
}

.process-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
}

.process-btn.reduced-width {
    width: 60%;
}

.mode-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-label {
    font-weight: 600;
    color: #2d3748;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-option {
    font-size: 14px;
    color: #4a5568;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-round {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #4299e1;
    transition: .4s;
    border-radius: 24px;
}

.slider-round:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-round {
    background-color: #48bb78;
}

input:checked + .slider-round:before {
    transform: translateX(26px);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-section,
.download-section,
.error-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background-color: #4299e1;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #718096;
    margin-bottom: 20px;
}

.log-container {
    margin-top: 30px;
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
}

.log-container h4 {
    margin-bottom: 15px;
    color: #2d3748;
}

.log-entries {
    max-height: 300px;
    overflow-y: auto;
    background-color: #f7fafc;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.log-entry {
    margin-bottom: 8px;
    display: flex;
    gap: 10px;
}

.log-time {
    color: #718096;
}

.log-level {
    font-weight: bold;
}

.log-info .log-level { color: #4299e1; }
.log-success .log-level { color: #48bb78; }
.log-warning .log-level { color: #ed8936; }
.log-error .log-level { color: #e53e3e; }

.log-message {
    flex: 1;
}

.download-btn {
    background-color: #48bb78;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: block;
    margin: 20px auto 0;
}

.download-btn:hover {
    background-color: #38a169;
}

.error-section {
    background-color: #fff5f5;
    border: 1px solid #feb2b2;
}

.error-section h3 {
    color: #e53e3e;
    margin-bottom: 15px;
}

#errorMessage {
    color: #742a2a;
    margin-bottom: 20px;
}

.retry-btn {
    background-color: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.retry-btn:hover {
    background-color: #c53030;
}

/* Footer styling */
.footer {
    text-align: center;
    margin-top: 40px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.page-download-container {
    margin-top: 20px;
}

.page-downloads button {
    margin-right: 10px;
    margin-bottom: 5px;
    padding: 6px 12px;
    background-color: #4299e1;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

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

.auth-container {
    max-width: 400px;
    margin: 60px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.error-text {
    color: #e53e3e;
    margin-top: 10px;
}

.auth-container form p {
    margin-top: 10px;
    text-align: center;
}
