* {
    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: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.about-link {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: 8px;
    display: inline-block;
}

.about-link:hover {
    color: white;
    text-decoration: underline;
}

main {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: #e8ebff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.upload-area p {
    font-size: 1.1rem;
    color: #666;
}

.processing-section {
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.result-section {
    text-align: center;
}

.result-section h2 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2rem;
}

.page-order {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
}

.page-order h3 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.sheet {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.sheet-title {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.sheet-pages {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-family: 'Courier New', monospace;
}

.side {
    padding: 5px;
    background: #f5f5f5;
    border-radius: 3px;
}

.side-title {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.download-btn, .reset-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover, .reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.reset-btn {
    background: #6c757d;
}

.reset-btn:hover {
    box-shadow: 0 10px 20px rgba(108, 117, 125, 0.3);
}

.instructions {
    margin-top: 40px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.instructions ol {
    margin-left: 20px;
}

.instructions li {
    margin-bottom: 8px;
}

.instructions ul {
    margin: 10px 0 10px 20px;
}

.instructions ul li {
    margin-bottom: 5px;
}

.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .sheet-pages {
        grid-template-columns: 1fr;
    }
}
