* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.main-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Upload Section */
.upload-section {
    padding: 60px 40px;
    text-align: center;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 15px;
    padding: 60px 40px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #fafafa;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-5px);
}

.upload-icon {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-area p {
    color: #666;
    margin-bottom: 30px;
}

.browse-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

/* Viewer Section */
.viewer-section {
    padding: 0;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.viewer-header h3 {
    color: #333;
    font-size: 1.3rem;
}

.viewer-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.control-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.close-btn {
    background: #e74c3c;
}

.close-btn:hover {
    background: #c0392b;
}

.page-info {
    color: #666;
    font-size: 0.9rem;
    margin: 0 10px;
}

.pdf-container {
    padding: 30px;
    text-align: center;
    background: #f8f9fa;
    min-height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pdfCanvas {
    max-width: 100%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border-radius: 8px;
}

/* Recent Files Section */
.recent-section {
    padding: 40px;
    border-top: 1px solid #eee;
}

.recent-section h3 {
    margin-bottom: 20px;
    color: #333;
}

.recent-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.recent-file {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.recent-file:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
}

.recent-file h4 {
    color: #333;
    margin-bottom: 5px;
    font-size: 1rem;
}

.recent-file p {
    color: #666;
    font-size: 0.9rem;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .upload-section {
        padding: 40px 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .viewer-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .viewer-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pdf-container {
        padding: 20px;
    }
    
    .recent-files {
        grid-template-columns: 1fr;
    }
}

/* Error Messages */
.error-message {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #c33;
}

.success-message {
    background: #efe;
    color: #363;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #363;
}