/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Temel reset */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* sayfa seviyesi kaydırmayı engelle -> slaytlar kendi içinde çalışsın */
  touch-action: pan-x; /* yatay kaydırmayı aktif et */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.presentation-container {
  width: 100%;
  height: 100vh;
  position: relative;
  background: #000; /* isterseniz arkaplan */
  overflow: hidden;
}

/* Vignette edges */
.presentation-container::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0) 60%, rgba(0,0,0,0.35) 100%);
    z-index: 50;
}

/* Navigation Controls */
.nav-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    pointer-events: none;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* SLIDE CONTAINER */

.slide-container {
  display: flex;
  height: 100vh;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 0;
  scrollbar-width: none; /* firefox */
}
.slide-container::-webkit-scrollbar { display: none; } /* webkit */

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 8px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* Neon Contact Button */
.contact-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 120;
    padding: 10px 18px;
    background: transparent;
    color: #27e1ff;
    border: 2px solid rgba(39, 225, 255, 0.7);
    border-radius: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, text-shadow 0.2s ease;
    text-shadow: 0 0 6px rgba(39, 225, 255, 0.9), 0 0 14px rgba(39, 225, 255, 0.6);
    box-shadow: 0 0 10px rgba(39, 225, 255, 0.6), inset 0 0 10px rgba(39, 225, 255, 0.2);
    backdrop-filter: blur(6px);
}

.contact-btn:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 0 18px rgba(39, 225, 255, 0.9), inset 0 0 12px rgba(39, 225, 255, 0.3);
    text-shadow: 0 0 10px rgba(39, 225, 255, 1), 0 0 20px rgba(39, 225, 255, 0.8);
}

/* Contact Modal */
.contact-modal {
    position: absolute;
    inset: 0;
    z-index: 110;
    display: none;
}

.contact-modal.open {
    display: block;
}

.contact-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.contact-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 92vw);
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 30px rgba(39, 225, 255, 0.15);
    padding: 22px 22px 18px 22px;
    color: #e6faff;
}

.contact-content h2 {
    font-size: 20px;
    margin-bottom: 14px;
    color: #89f3ff;
    text-shadow: 0 0 8px rgba(39,225,255,0.5);
}

.contact-links {
    display: flex;
    gap: 12px;
}

.contact-link {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-link.telegram {
    background: linear-gradient(135deg, #2aabee, #199bd1);
    color: white;
    box-shadow: 0 8px 20px rgba(32, 164, 220, 0.45);
}

.contact-link.telegram:hover { transform: translateY(-1px) scale(1.03); }

.contact-link.teams {
    background: linear-gradient(135deg, #6264a7, #4f52a1);
    color: white;
    box-shadow: 0 8px 20px rgba(98, 100, 167, 0.45);
}

.contact-link.teams:hover { transform: translateY(-1px) scale(1.03); }

.contact-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #cdefff;
    font-size: 20px;
    cursor: pointer;
}

.contact-close:hover {
    background: rgba(255,255,255,0.18);
}

/* Slide Container */
.slide-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  gap: 1rem;
  padding: 1rem 0;
}

.slide {
  position: relative;
  flex: 0 0 100%;
  width: 100vw;
  height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* bulanık alan dışarı taşmasın */
  background: #000; /* blur yüklenmezse siyah görünür */
}

.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-image) center/cover no-repeat;
  filter: blur(40px) brightness(0.5) saturate(1.2);
  transform: scale(1.2);
  z-index: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.slide.has-bg::before {
  opacity: 1;
}

/* Resim %90 boyutunda ortalanıyor */
.slide-image {
  position: relative;
  width: 90%;
  height: 90%;
  object-fit: contain;
  z-index: 1;
  border-radius: 12px;
  box-shadow: 
    0 0 30px rgba(0,0,0,0.6),
    0 0 60px rgba(0,0,0,0.3),
    inset 0 0 20px rgba(255,255,255,0.1);
  filter: drop-shadow(0 0 15px rgba(0,0,0,0.5));
  border: 1px solid rgba(255,255,255,0.1);
}

/* İletişim butonu / modal ve ilerleme çubuğu basit stiller */
.contact-btn { position: absolute; right: 1rem; top: 1rem; z-index: 50; }
.contact-modal { /* mevcut stilinizle bırakabilirsiniz */ }

}

.slide-image:hover {
    transform: scale(1.02);
    box-shadow: 
      0 0 40px rgba(0,0,0,0.8),
      0 0 80px rgba(0,0,0,0.4),
      inset 0 0 25px rgba(255,255,255,0.15);
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.7));
    border: 1px solid rgba(255,255,255,0.2);
}

/* Thumbnail Navigation */
.thumbnail-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    z-index: 100;
    max-width: 90%;
    overflow-x: auto;
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.thumbnail {
    position: relative;
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    flex-shrink: 0;
}

.thumbnail:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.thumbnail.active {
    border-color: #4CAF50;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.5);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-number {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Progress bar (isteğe bağlı) */
.progress-bar {
  position: absolute;
  left: 0;
  bottom: 0.6rem;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  z-index: 40;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00d4ff, #7b61ff);
  transition: width 300ms linear;
}

/* Fullscreen Styles */
body.fullscreen .presentation-container {
    background: #000;
}

body.fullscreen .nav-controls {
    opacity: 0.8;
}

body.fullscreen .thumbnail-nav {
    opacity: 0.8;
}

body.fullscreen .fullscreen-btn {
    opacity: 0.8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .slide-counter {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .thumbnail {
        width: 60px;
        height: 45px;
    }
    
    .thumbnail-nav {
        padding: 10px;
        bottom: 10px;
    }
    
    .fullscreen-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .nav-controls {
        padding: 0 10px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .thumbnail {
        width: 50px;
        height: 38px;
    }
    
    .thumbnail-container {
        gap: 8px;
    }
}

/* Loading Animation */
.slide-image {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Smooth Transitions */
.slide {
    transition: opacity 0.5s ease-in-out;
}

/* Custom Scrollbar for Thumbnails */
.thumbnail-nav::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.thumbnail-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.thumbnail-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Focus States for Accessibility */
.nav-btn:focus,
.fullscreen-btn:focus,
.thumbnail:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .nav-btn {
        border: 2px solid #000;
    }
    
    .slide-counter {
        border: 1px solid #fff;
    }
    
    .thumbnail.active {
        border-width: 4px;
    }
}

/* ------------------------------- */
/* Book Mode: Two-page Spread      */
/* ------------------------------- */
body.book .slide-container {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 20px; /* gutter */
    padding: 20px 40px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.05), rgba(0,0,0,0.5));
    perspective: 2000px; /* for 3D flips */
}

body.book .slide {
    display: none; /* hidden by default; JS will add show-left/show-right */
    padding: 0;
}

body.book .slide.show-left,
body.book .slide.show-right {
    display: flex;
    width: 50%;
    height: 100%;
}

body.book .slide.show-left .slide-image,
body.book .slide.show-right .slide-image {
    border-radius: 6px;
    background: #111;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(0,0,0,0.3);
    backface-visibility: hidden;
    transform-style: preserve-3d;
    will-change: transform, opacity;
    position: relative;
    overflow: hidden;
}

/* Simulate a spine shadow between pages */
body.book .slide-container::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), rgba(0,0,0,0.6), rgba(255,255,255,0.15));
    left: 50%;
    transform: translateX(-1px);
    pointer-events: none;
}

/* Single first page: center and widen left, hide right */
body.book.single-first .slide-container {
    gap: 0;
}

body.book.single-first .slide.show-left {
    width: 70%;
    margin: 0 auto;
}

body.book.single-first .slide.show-right {
    display: none !important;
}

/* Page flip animations */
.flip-in-left .slide-image {
    transform-origin: right center;
    animation: flipInLeft 600ms ease both;
}

.flip-in-right .slide-image {
    transform-origin: left center;
    animation: flipInRight 600ms ease both;
}

@keyframes flipInLeft {
    0% {
        transform: rotateY(-90deg) scale(0.98);
        opacity: 0;
    }
    60% {
        transform: rotateY(10deg) scale(1.0);
        opacity: 1;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

@keyframes flipInRight {
    0% {
        transform: rotateY(90deg) scale(0.98);
        opacity: 0;
    }
    60% {
        transform: rotateY(-10deg) scale(1.0);
        opacity: 1;
    }
    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* Curl shadow/highlight overlays during flip */
.curl-left .slide-image::before,
.curl-right .slide-image::before,
.curl-left .slide-image::after,
.curl-right .slide-image::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    pointer-events: none;
    opacity: 0;
}

/* Shadow */
.curl-left .slide-image::before {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.45), rgba(0,0,0,0));
    animation: curlShadowLeft 600ms ease both;
}

.curl-right .slide-image::before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.45), rgba(0,0,0,0));
    animation: curlShadowRight 600ms ease both;
}

/* Highlight */
.curl-left .slide-image::after {
    right: 0;
    background: linear-gradient(to left, rgba(255,255,255,0.35), rgba(255,255,255,0));
    animation: curlHighlightLeft 600ms ease both;
}

.curl-right .slide-image::after {
    left: 0;
    background: linear-gradient(to right, rgba(255,255,255,0.35), rgba(255,255,255,0));
    animation: curlHighlightRight 600ms ease both;
}

@keyframes curlShadowLeft {
    0% { opacity: 0; transform: translateX(10%); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateX(0%); }
}

@keyframes curlShadowRight {
    0% { opacity: 0; transform: translateX(-10%); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateX(0%); }
}

@keyframes curlHighlightLeft {
    0% { opacity: 0; transform: translateX(15%); }
    50% { opacity: 0.8; }
    100% { opacity: 0; transform: translateX(0%); }
}

@keyframes curlHighlightRight {
    0% { opacity: 0; transform: translateX(-15%); }
    50% { opacity: 0.8; }
    100% { opacity: 0; transform: translateX(0%); }
}

/* Mobile: fall back to single page */
@media (max-width: 900px) {
    body.book .slide-container {
        gap: 0;
        padding: 10px;
    }
    body.book .slide.show-left,
    body.book .slide.show-right {
        width: 100%;
    }
    body.book .slide.show-right {
        display: none; /* hide right page on small screens */
    }
}
