@import url('https://fonts.googleapis.com/css2?family=Atma:wght@300;400;500;600;700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

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

body {
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 20px;
    min-height: 100vh;
}

.container {
    display: flex;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.book-preview {
    flex: 1;
    background: #2d2d2d;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: 80px; /* Platz für die Buttons */
}

.pages-container {
    flex: 1;
    min-height: 0;
    position: relative;
}

.book-preview::-webkit-scrollbar {
    width: 8px;
}

.book-preview::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.book-preview::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.book-preview::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.page-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    cursor: move;
    position: relative;
}

.page-container.ui-sortable-helper {
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    background: #2d2d2d;
    border-radius: 8px;
    padding: 10px;
}

.page-container.ui-sortable-placeholder {
    visibility: visible !important;
    background: #3d3d3d;
    border: 2px dashed #4a4a4a;
    margin-bottom: 20px;
    border-radius: 8px;
}

.page {
    flex: 1;
    aspect-ratio: 1;
    background: #3d3d3d;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.page-content {
    width: 100%;
    height: 100%;
    position: relative;
    background: #ffffff;
    color: #000;
    font-family: 'Atma';
    font-weight: 400;
}

.left-page {
    border-right: 2px solid #4a4a4a;
}

.right-page {
    border-left: 2px solid #4a4a4a;
}

.image-gallery {
    width: 440px;
    background: #2d2d2d;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    flex-shrink: 0;
}

.image-gallery::-webkit-scrollbar {
    width: 8px;
}

.image-gallery::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.image-gallery::-webkit-scrollbar-thumb {
    background: #4a4a4a;
    border-radius: 4px;
}

.image-gallery::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin-top: 20px;
}

.gallery-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    cursor: move;
    border: 1px solid #4a4a4a;
    border-radius: 4px;
}

.page-controls {
    display: flex;
    gap: 10px;
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 498px; /* Platz für die Bildergalerie */
    background: #2d2d2d;
    padding: 15px;
    z-index: 1000;
    border-top: 1px solid #4a4a4a;
    justify-content: center;
}

button {
    padding: 8px 16px;
    background-color: #4a4a4a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #5a5a5a;
}

.draggable-image {
    width: 100%;
    height: 100%;
    position: absolute;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3d3d3d;
}

.draggable-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.text-content {
    display: none;
}

.delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: none;
    transition: background-color 0.3s;
}

.delete-btn:hover {
    background: #ff6666;
}

.draggable-image:hover .delete-btn {
    display: block;
}

/* Stelle sicher, dass der Text-Bereich immer über anderen Elementen liegt */
.text-content {
    z-index: 2000;
    font-size: 25px;
}

.left-page .page-content {
    cursor: text;
    font-size: 30px;
    padding: 60px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    flex-flow: column;
    white-space: pre-wrap; /* Behält Zeilenumbrüche bei */
}

.left-page .page-content:focus {
    outline: none;
}

.left-page .page-content:empty::before {
    content: 'Text hier eingeben...';
    color: #888;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.book-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    background: #3d3d3d;
    border-radius: 4px;
}

#bookSelect {
    flex: 1;
    padding: 8px;
    background: #4a4a4a;
    color: white;
    border: 1px solid #5a5a5a;
    border-radius: 4px;
    font-size: 14px;
}

#bookSelect option {
    background: #4a4a4a;
    color: white;
}

#newBook {
    padding: 8px 16px;
    background-color: #4a4a4a;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    white-space: nowrap;
}

#newBook:hover {
    background-color: #5a5a5a;
}

.page-sort-controls {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 100;
}

.page-sort-controls button {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4a4a4a;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    color: white;
}

.page-sort-controls button:hover {
    background: #5a5a5a;
}

.page-sort-controls button:disabled {
    background: #2a2a2a;
    cursor: not-allowed;
    opacity: 0.5;
}

.page-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 10;
}

.pdf-container {
    background: white;
    width: 1200px;
}

.pdf-page-container {
    display: flex;
    gap: 20px;
    page-break-after: always;
    margin: 0;
    padding: 20px;
    background: white;
    justify-content: center;
}

.pdf-container .page {
    width: 500px;
    height: 500px;
    border: 1px solid #000;
    position: relative;
    background: white;
    margin: 0 20px;
}

.pdf-container .page-content {
    width: 100%;
    height: 100%;
    background: white;
    color: #000;
    font-family: 'Atma';
    padding: 60px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pdf-container .draggable-image {
    pointer-events: none;
}

.pdf-container .draggable-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pdf-container .page-number {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #000;
    font-size: 14px;
    z-index: 10;
    background: none;
} 