body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
}

.container {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.file-list {
    min-height: 120px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    background-color: #fff;
}

.file-item {
    display: block;
    padding: 0;
    margin: 0.5rem 0;
    background-color: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
    cursor: grab;
    user-select: none;
}

.file-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.file-item:active {
    cursor: grabbing;
}

.file-item.sortable-ghost {
    opacity: 0.3;
    background-color: #e7f5e7;
    box-shadow: 0 0 0 1px #4CAF50;
}

.file-item.sortable-chosen {
    background-color: #f0f9f0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

.file-item.sortable-drag {
    opacity: 0.8;
    background-color: #fff;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.file-item-content {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
}

.file-name {
    flex: 1;
    margin-right: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.drag-handle {
    color: #6c757d;
    cursor: move;
    user-select: none;
}


.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: #fff;
    border-radius: 8px;
    margin-top: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page {
    position: relative;
    border: 1px solid #dee2e6;
    padding: 1rem;
    text-align: center;
    cursor: move;
    background: white;
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.page:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.file-name {
    flex: 1;
    margin-right: 0.5rem;
}

.page.selected {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.page-delete {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    color: #adb5bd;
    transition: color 0.2s;
    padding: 0;
}

.page-delete:hover {
    color: #000000;
}

.page-number {
    margin-top: 0.75rem;
    color: #6c757d;
    font-size: 0.875rem;
}

canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.controls button {
    background-color: #4CAF50;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    margin-right: 1rem;
}

.controls button:hover {
    background-color: #45a049;
}

.controls button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.progress {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #e9ecef;
    border-radius: 6px;
    text-align: center;
    display: none;
}

.remove-file {
    cursor: pointer;
    color: #6c757d;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-file:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}


.grid {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.page {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.file-list {
    min-height: 120px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    background-color: #fff;
    transition: all 0.3s ease;
}

.file-list.drag-over {
    border-color: #4CAF50;
    background-color: #f0f9f0;
    transform: scale(1.02);
}

.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #333;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.github-link:hover {
    background-color: #f0f0f0;
}

.github-logo {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

