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

:root {
    --page-width-ratio: 848;
    --page-height-ratio: 1200;
    --primary-color: #c0392b;
    --secondary-color: #ffffff;
    --text-color: #333;
    --white: #fff;
    --logo-url: 'https://aticturkiye.org/wp-content/uploads/2024/05/cb8fe0_ce732991e9744d61ba6957614aa26331mv2-e1715467030602.png';
    --arrow-color: #001f5c;
}

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
	font-family: "Poppins", sans-serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--secondary-color);
}

body {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Ana konteyner - tüm sayfayı kapsar */
.main-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Üst alan - logoların olduğu kısım */
.header-area {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 20px;
    z-index: 10;
}

.logo-left, .logo-right {
    width: min(calc(8vw + 40px), 180px);
    height: min(calc(8vw + 40px), 180px);
    background-image: url(https://aticturkiye.org/wp-content/uploads/2024/05/cb8fe0_ce732991e9744d61ba6957614aa26331mv2-e1715467030602.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    z-index: 10;
    pointer-events: none;
}

/* Ana içerik alanı - flipbook ve butonlar */
.content-area {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
    padding: 0 10px;
}

/* Flipbook konteyner */
.flipbook-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 80%;
    height: 85vh;
    overflow: visible;
    max-width: 1400px;
    flex-direction: column;
}

/* Yan butonlar konteyner */
.navigation-buttons {
    position: absolute;
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
}

/* Yan oklar stilleri */
.side-arrow {
    position: relative;
    width: min(calc(2vw + 25px), 40px);
    height: min(calc(8vh + 60px), 120px);
    background-color: var(--arrow-color);
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: clamp(14px, 1.5vw, 18px);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    pointer-events: auto;
    align-self: center;
    margin: 0 20px;
}

.side-arrow:hover {
    background-color: white;
    color: var(--arrow-color);
    transform: scale(1.05);
    border: 2px solid var(--arrow-color);
}

/* Sayfa çevirme yönergesi */
.page-turn-hint {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(0,0,0,0.75);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: clamp(11px, 0.8vw + 4px, 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 100;
    opacity: 0;
    transition: all 0.5s ease;
    pointer-events: none;
    text-align: center;
    max-width: 90vw;
    white-space: normal;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.page-turn-hint.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.page-turn-hint i {
    font-size: clamp(12px, 0.8vw + 6px, 18px);
    color: #ffcc00;
    animation: swipeAnimation 2s infinite;
}

@keyframes swipeAnimation {
    0% { transform: translateX(0); }
    50% { transform: translateX(10px); }
    100% { transform: translateX(0); }
}

.flipbook-wrapper {
    position: relative;
    transition: transform 0.2s ease-out;
    transform-origin: center center;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.flipbook-wrapper.dragging {
    transition: none;
    cursor: grabbing !important;
}

.flipbook {
    width: 100%;
    height: 100%;
    max-width: min(85vw, calc(80vh * (var(--page-width-ratio) * 2) / var(--page-height-ratio)));
    max-height: min(80vh, calc(85vw * var(--page-height-ratio) / (var(--page-width-ratio) * 2)));
    margin: 0 auto !important;
    left: 0 !important;
    transform-origin: center center;
}

.flipbook .hard {
    background: var(--primary-color) !important;
    color: var(--white);
    font-weight: bold;
    border: none; 
}

.flipbook .hard small{
	font-style: italic;
	font-weight: lighter;
	opacity: 0.7;
	font-size: 14px;
}

.flipbook .page {
    background: white;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.11);
    aspect-ratio: var(--page-width-ratio) / var(--page-height-ratio);
}

.page img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
}

.flipbook .page small {
	font-size: 14px;
    margin-bottom: 0;
}

/* Alt kontrol alanı */
.controls-area {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 10px 0;
    position: relative;
    z-index: 100;
    margin-top: 10px;
}

/* Kontrol öğeleri */
.controls {
    display: flex;
    gap: clamp(5px, 0.8vw, 10px);
    background: rgba(255, 255, 255, 0.7);
    padding: clamp(5px, 0.8vw, 8px) clamp(8px, 1.2vw, 15px);
    border-radius: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    opacity: 1; /* Her zaman görünür olsun */
    z-index: 100;
    align-items: center; /* Tüm öğeleri dikey ortala */
}

.control-btn {
    border: none;
    width: clamp(24px, 2.5vw, 32px);
    height: clamp(24px, 2.5vw, 32px);
    border-radius: 50%;
    background: var(--white);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-size: clamp(10px, 0.8vw, 12px);
}

.control-btn:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zoom-level {
    display: flex;
    align-items: center;
    padding: 0 5px;
    font-weight: 500;
    font-size: clamp(10px, 0.8vw, 12px);
}

.page-number {
    font-size: clamp(10px, 0.8vw, 12px);
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    margin: 0 5px;
    display: flex;
    align-items: center;
    height: clamp(24px, 2.5vw, 32px); /* Butonlarla aynı yükseklikte */
    justify-content: center;
}

/* Zoom göstergesi */
.zoom-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: clamp(10px, 0.8vw, 12px);
    opacity: 0;
    transition: opacity 0.3s;
}

.zoom-indicator.visible {
    opacity: 1;
}

/* Single-page görünüm için özel stil */
.flipbook-wrapper[data-display="single"] .flipbook {
    margin: 0 auto !important;
}

/* RESPONSIVE MEDYA SORGULARI */

/* Geniş ekranlar için (1440px ve üzeri) */
@media screen and (min-width: 1440px) {
    .logo-left, .logo-right {
        width: 150px;
        height: 150px;
    }
    
    .side-arrow {
        width: 36px;
        height: 100px;
        margin: 0 40px;
    }
}

/* Tablet ve daha küçük cihazlar için (1024px'e kadar) */
@media screen and (max-width: 1024px) {    
    .header-area {
        padding: 15px;
    }
    
    .logo-left, .logo-right {
        width: min(calc(6vw + 30px), 120px);
        height: min(calc(6vw + 30px), 120px);
    }
    
    .side-arrow {
        width: min(calc(1.5vw + 20px), 32px);
        height: min(calc(6vh + 40px), 90px);
        font-size: 14px;
        margin: 0 15px;
    }
    
    .flipbook-container {
        width: 90%;
    }
}

/* Mobil cihazlar için (768px'e kadar) düzenlemeler */
@media screen and (max-width: 768px) {
    .header-area {
        padding: 10px 5px;
    }
    
    .logo-left, .logo-right {
        width: 80px;
        height: 80px;
    }
    
    .content-area {
        padding: 0;
    }
    
    .flipbook-container {
        width: 100% !important;
        height: 70vh;
        margin: 0;
        padding-bottom: 80px; /* Kontroller için daha fazla boşluk bırak */
    }

    .flipbook {
        max-width: 100% !important;
        max-height: 70vh;
        /* Single page display for mobile */
    }
    
    .controls {
        padding: 5px 10px;
        gap: 5px;
    }
    
    .control-btn {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
    
    .page-number, .zoom-level {
        font-size: 10px;
    }
    
    /* Sayfa çevirme yönergesini üste taşı */
    .page-turn-hint {
        bottom: auto;
        top: -40px; /* Sayfanın üzerinde göster */
        font-size: 12px;
        padding: 8px 12px;
        max-width: 90vw;
        white-space: normal;
        text-align: center;
        transform: translateX(-50%) translateY(0);
    }
    
    /* Mobilde yan okları gizle */
    .navigation-buttons {
        display: none !important;
    }
    
    .controls-area {
        position: absolute;
        bottom: 15px; /* Sayfalardan daha aşağıda olsun */
        left: 0;
        right: 0;
        padding: 5px 0;
    }
}

/* Küçük mobil cihazlar için (576px'e kadar) */
@media screen and (max-width: 576px) {
    .logo-left, .logo-right {
        width: 70px;
        height: 70px;
    }
    
    .flipbook-container {
        height: 65vh;
        width: 100% !important;
        padding-bottom: 85px; /* Daha fazla alt boşluk */
    }
    
    .flipbook {
        max-height: 65vh;
        max-width: 100% !important;
    }
    
    /* Çok küçük ekranlarda yan okları tamamen gizle */
    .side-arrow {
        display: none;
    }
    
    .page-turn-hint {
        top: -35px;
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .page-turn-hint i {
        font-size: 12px;
    }
    
    .control-btn {
        width: 24px;
        height: 24px;
    }
    
    /* Mobilde logoları küçült */
    .header-area {
        padding: 5px 2px;
    }
    
    .controls-area {
        bottom: 20px;
    }
}

/* Geniş ama alçak ekranlar için (16:9 veya daha geniş oranlar) */
@media screen and (min-aspect-ratio: 16/9) {
    .header-area {
        padding: 10px 20px;
    }
    
    .logo-left, .logo-right {
        width: 70px;
        height: 70px;
    }
    
    .flipbook-container {
        height: 75vh;
    }
    
    .side-arrow {
        height: min(calc(6vh + 30px), 90px);
    }
    
    .flipbook {
        max-height: 75vh;
    }
}

/* Yüksekliği az olan cihazlar (Yatay modda telefonlar gibi) için */
@media screen and (max-height: 500px) {
    .header-area {
        padding: 5px 10px;
    }
    
    .logo-left, .logo-right {
        width: 50px;
        height: 50px;
    }
    
    .flipbook-container {
        height: 80vh;
        padding-bottom: 70px;
    }
    
    .side-arrow {
        height: 60px;
        width: 30px;
        margin: 0 5px;
    }
    
    .page-turn-hint {
        top: -30px;
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .flipbook {
        max-height: 80vh;
    }
    
    .controls-area {
        bottom: 10px;
    }
}

/* Çok geniş ekranlar için (21:9 ultra-wide gibi) */
@media screen and (min-aspect-ratio: 21/9) {
    .main-container {
        padding: 0;
        justify-content: center;
    }
    
    .header-area {
        position: absolute;
        top: 0;
        left: 0;
        padding: 20px;
        z-index: 20;
    }
    
    .flipbook-container {
        height: 80vh;
        width: 70%;
    }
    
    .side-arrow {
        margin: 0 50px;
    }
}

