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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(to right, #4A90E2 0%, #7B68EE 50%, #6A5ACD 100%);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

/* Hexagonal grid pattern */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 50px, rgba(255, 255, 255, 0.05) 50px, rgba(255, 255, 255, 0.05) 51px),
        repeating-linear-gradient(60deg, transparent, transparent 50px, rgba(255, 255, 255, 0.05) 50px, rgba(255, 255, 255, 0.05) 51px),
        repeating-linear-gradient(120deg, transparent, transparent 50px, rgba(255, 255, 255, 0.05) 50px, rgba(255, 255, 255, 0.05) 51px);
    background-size: 100px 100px;
    opacity: 0.4;
    z-index: 0;
}

/* Science icons overlay */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M20 20 Q30 30 20 40 Q30 50 20 60 Q30 70 20 80 M30 20 Q20 30 30 40 Q20 50 30 60 Q20 70 30 80' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M30 20 L30 40 L25 60 L25 80 L35 80 L35 60 L30 40 Z' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='30' cy='70' r='15' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3Cpath d='M30 55 L30 40 L40 30' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='70' cy='30' r='8' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3Cellipse cx='70' cy='30' rx='25' ry='8' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3Cellipse cx='70' cy='30' rx='25' ry='8' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none' transform='rotate(60 70 30)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='65' y='40' width='8' height='40' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3Crect x='75' y='40' width='8' height='40' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3Crect x='85' y='40' width='8' height='40' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='70' cy='70' r='15' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3Cpath d='M70 55 L70 40 L60 30' stroke='rgba(255,255,255,0.15)' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-size:
        120px 120px,
        100px 100px,
        100px 100px,
        120px 120px,
        100px 100px,
        100px 100px;
    background-position:
        5% 5%,
        8% 45%,
        5% 85%,
        95% 5%,
        92% 45%,
        95% 85%;
    background-repeat: no-repeat;
    opacity: 0.6;
    z-index: 0;
}

#flipbook-wrapper {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 20px;
}

#flipbook-container {
    position: relative;
    margin: auto;
    transition: transform 0.3s ease;
}

#flipbook {
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#flipbook .page {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

#flipbook .page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to left,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.02) 50%,
            rgba(0, 0, 0, 0.05) 100%);
    pointer-events: none;
}

#flipbook .page img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Alt kontrol çubuğu - FlipHTML5 tarzı */
#controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    max-width: 95vw;
}

#controls button {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

#controls button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#controls button:active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0.95);
}

#controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-counter {
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    min-width: 80px;
    text-align: center;
    white-space: nowrap;
}

.page-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 20px;
}

#page-input {
    width: 50px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.2s;
}

#page-input:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

#page-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#go-to-page-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    width: auto;
    height: auto;
}

#go-to-page-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 20px;
}

#zoom-level {
    color: white;
    font-size: 14px;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

#sound-toggle {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 20px;
}

#sound-toggle.muted {
    color: #ff6b6b;
}

/* Yükleme animasyonu */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #48c6ef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.5s;
}

#loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px 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);
    }
}

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 600;
}

/* ===== RESPONSIVE — Tablet ===== */
@media (max-width: 1050px) {
    #controls {
        padding: 10px 20px;
        gap: 15px;
    }
}

/* ===== RESPONSIVE — Küçük Tablet / Büyük Telefon ===== */
@media (max-width: 768px) {
    #flipbook-wrapper {
        padding: 10px;
    }

    #controls {
        bottom: 10px;
        padding: 8px 16px;
        gap: 8px;
        border-radius: 40px;
    }

    #controls button {
        width: 36px;
        height: 36px;
        font-size: 18px;
        padding: 6px;
    }

    .page-counter {
        font-size: 13px;
        min-width: 70px;
        padding: 4px 10px;
    }

    .page-input-container {
        display: none;
    }

    .zoom-controls {
        display: none;
    }

    #sound-toggle {
        display: none;
    }
}

/* ===== RESPONSIVE — Telefon ===== */
@media (max-width: 480px) {
    #flipbook-wrapper {
        padding: 5px;
    }

    #controls {
        bottom: 8px;
        padding: 6px 12px;
        gap: 6px;
        border-radius: 30px;
    }

    #controls button {
        width: 32px;
        height: 32px;
        font-size: 16px;
        padding: 4px;
    }

    .page-counter {
        font-size: 12px;
        min-width: 60px;
        padding: 3px 8px;
    }
}