/* ========================================
   GUIDE MENU COMPONENT STYLES
   ======================================== */

/* CSS Variables - Scoped to guide components */
:root {
    --guide-btn-size: 30px;
    --guide-btn-bottom: 24px;
    --guide-btn-right: 24px;
    --guide-item-size: 45px;
    --guide-backdrop-bg: rgba(0, 0, 0, 0.35);
    --guide-menu-bg: #f6f6f6;
    --guide-accent: #f2b13a;
    --guide-radius: 120px;
    --guide-arc-deg: 100;
    --guide-animation-duration: 380ms;
    --guide-item-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    --guide-mobile-item-gap: 16px;
}

/* ========================================
   BACKDROP STYLES
   ======================================== */

.guide-backdrop-mobile,
.guide-backdrop-desktop {
    position: fixed;
    inset: 0;
    background: transparent;
    opacity: 0;
    pointer-events: none;
    transition: background var(--guide-animation-duration) ease,
    opacity var(--guide-animation-duration) ease;
    z-index: 1202;
}

.guide-backdrop-mobile.visible,
.guide-backdrop-desktop.visible {
    background: var(--guide-backdrop-bg);
    opacity: 1;
    pointer-events: auto;
}

/* ========================================
   GUIDE WRAPPER
   ======================================== */

.guide-wrap {
    position: fixed;
    right: var(--guide-btn-right);
    bottom: var(--guide-btn-bottom);
    z-index: 1202;
    width: var(--guide-btn-size);
    height: var(--guide-btn-size);
    pointer-events: none;
}

/* Mobile/Desktop Visibility */
.guide-wrap-mobile {
    visibility: hidden;
}

.guide-wrap-desktop {
    visibility: visible;
    position: absolute;
    bottom: 15px;
    right: 30px;
}

/* ========================================
   GUIDE BUTTON
   ======================================== */

.guide-wrap .guide-btn {
    width: var(--guide-btn-size);
    height: var(--guide-btn-size);
    border-radius: 50%;
    background: var(--guide-accent);
    border: 5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    color: #ffffff;
    cursor: pointer;
    pointer-events: auto;
    position: absolute;
    right: 0;
    bottom: 0;
    transition: transform 220ms ease,
    background 220ms ease,
    color 220ms ease;
    user-select: none;
    z-index: 1202;
}

.guide-wrap .guide-btn:active {
    transform: scale(0.96);
}

.guide-wrap .guide-btn .help {
    display: flex;
    transition: color 220ms ease;
    margin-bottom: -2px;
}

.guide-wrap .guide-btn .up {
    display: none;
}

.guide-wrap .guide-btn.back-to-top .up {
    display: flex;
}

.guide-wrap .guide-btn.back-to-top .help {
    display: none;
}

/* Button Hover State */
.guide-wrap.open .guide-btn,
.guide-wrap:hover .guide-btn {
    background: #ffffff;
    color: #f9b233;
    border: 2px solid #f9b233;
}

/* ========================================
   GUIDE ITEMS (Menu Items)
   ======================================== */

.guide-wrap .guide-item {
    position: absolute !important;
    right: 1px;
    bottom: calc((var(--guide-btn-size) - var(--guide-item-size)) / 2);
    width: var(--guide-item-size);
    height: var(--guide-item-size);
    border: 1px solid transparent;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--guide-item-shadow);
    --guide-tx: 0;
    --guide-ty: 0;
    --guide-scale: 1;
    transform: translate(var(--guide-tx), var(--guide-ty)) scale(var(--guide-scale));
    opacity: 0;
    visibility: hidden;
    transition: transform var(--guide-animation-duration) cubic-bezier(0.2, 0.9, 0.3, 1),
    opacity calc(var(--guide-animation-duration) / 1.2) ease,
    visibility calc(var(--guide-animation-duration) / 1.2) ease;
    pointer-events: auto;
    will-change: transform, opacity, visibility;
}
@media (max-width: 550px) {
    .guide-wrap .guide-item {
        right: 2px;
    }
}

.guide-wrap.open .guide-item {
    visibility: visible;
    opacity: 1;
}

.guide-wrap .guide-item:hover {
    --guide-scale: 1.25;
    z-index: 5;
    cursor: pointer;
}

/* ========================================
   GUIDE ITEM - TOOLTIP
   ======================================== */

.guide-wrap .guide-item .es-tooltip {
    white-space: nowrap;
    background-color: #1f2937;
    color: #ffffff;
    user-select: none;
}

.guide-wrap .guide-item .es-tooltip::after {
    border-color: #1f2937 transparent transparent transparent;
}

/* Special positioning for quick-introduction */
.guide-wrap .guide-item[data-action="quick-introduction"] .es-tooltip {
    left: -50% !important;
}

.guide-wrap .guide-item[data-action="quick-introduction"] .es-tooltip::after {
    left: 78% !important;
}

/* ========================================
   GUIDE ITEM - TEXT LABELS
   ======================================== */

.guide-wrap .guide-item .guide-item-text {
    display: none;
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    justify-content: center;
    align-items: center;
    direction: rtl;
}

.guide-wrap .guide-item .guide-item-text .dash {
    width: 30px;
    height: 1px;
    border-top: 1px dashed #f9b233;
}

.guide-wrap .guide-item .guide-item-text .text {
    white-space: nowrap;
    color: #646474;
    font-size: 12px;
    background: #ffffff;
    border: 1px solid #f9b233;
    border-radius: 5px;
    padding: 5px 12px;
    user-select: none;
}

/* ========================================
   RESPONSIVE: DESKTOP (min-width: 991px)
   ======================================== */

@media (min-width: 991px) {
    :root {
        --guide-btn-size: 35px;
    }
}

/* ========================================
   RESPONSIVE: TABLET/MOBILE (max-width: 991px)
   ======================================== */

@media (max-width: 991px) {
    :root {
        --guide-btn-bottom: 150px;
        --guide-btn-right: 18px;
    }

    .guide-wrap-mobile {
        visibility: visible;
    }

    .guide-wrap-desktop {
        visibility: hidden;
    }

    .guide-wrap .guide-btn {
        border: 2px solid #f9b233;
        width: 45px;
        height: 45px;
    }

    .guide-wrap .guide-item {
        border: 1px solid #f9b233;
        background: #ffffff;
    }

    .guide-wrap .guide-item .es-tooltip {
        display: none;
    }

    .guide-wrap .guide-item .guide-item-text {
        display: flex;
    }
}

/* ========================================
   RESPONSIVE: MOBILE (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    .guide-wrap .guide-item .guide-item-text .text {
        font-size: 11px;
    }

    .guide-wrap .guide-item .guide-item-text .dash {
        width: 20px;
    }
}

/* ========================================
   RESPONSIVE: SMALL MOBILE (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {
    :root {
        --guide-item-size: 30px;
        --guide-btn-size: 35px;
        --guide-mobile-item-gap: 12px;
        --guide-btn-right: 12px;
        --guide-btn-bottom: 160px;
    }

    .guide-wrap .guide-btn {
        font-size: 16px;
        width: var(--guide-btn-size);
        height: var(--guide-btn-size);
        border: 2px solid #f9b233;
    }

    .guide-wrap .guide-item .guide-item-text .text {
        font-size: 10px;
    }

    .guide-wrap .guide-item .guide-item-text .dash {
        width: 15px;
    }
}

/* ========================================
   BOOK GALLERY COMPONENT STYLES
   ======================================== */

.book-gallery-container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

/* Main Swiper */
.book-gallery-container .main-swiper {
    width: 100%;
    position: relative;
}

.book-gallery-container .main-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Book Pages */
.book-gallery-container .book-page {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    background: white;
}

.book-gallery-container .book-page:hover {
    transform: scale(1.02);
}

/* Page Placeholders */
.book-gallery-container .page-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.book-gallery-container .page-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: rotate(45deg);
    animation: book-shimmer 3s infinite;
}

@keyframes book-shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.book-gallery-container .page-number {
    font-size: 3rem;
    margin-bottom: 10px;
}

.book-gallery-container .page-title {
    font-size: 1rem;
    opacity: 0.9;
    text-align: center;
}

/* Navigation Arrows */
.book-gallery-container .swiper-button-next,
.book-gallery-container .swiper-button-prev {
    background: rgba(255, 255, 255, 0.9);
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.book-gallery-container .swiper-button-next:hover,
.book-gallery-container .swiper-button-prev:hover {
    background: white;
    transform: scale(1.1);
}

.book-gallery-container .swiper-button-next::after,
.book-gallery-container .swiper-button-prev::after {
    font-size: 18px !important;
    font-weight: bold;
    color: #333;
}

/* Thumbnails Container */
.book-gallery-container .thumbnails-container {
    padding: 20px;
}

.book-gallery-container .thumbs-swiper {
    width: 100%;
    height: auto;
}

.book-gallery-container .thumbs-swiper .swiper-slide {
    width: auto;
    height: auto;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.book-gallery-container .thumbs-swiper .swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.book-gallery-container .thumbs-swiper .swiper-slide:hover::before {
    opacity: 1;
}

.book-gallery-container .thumbs-swiper .swiper-slide-thumb-active::before {
    opacity: 0;
}

.book-gallery-container .thumbs-swiper .swiper-slide-thumb-active {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Thumbnail Images */
.book-gallery-container .thumb-page {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.book-gallery-container .thumb-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Loading State */
.book-gallery-container .swiper-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.book-gallery-container .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: book-spinner 1s linear infinite;
}

@keyframes book-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error State */
.book-gallery-container .error-message {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    font-size: 1.1rem;
}

/* ========================================
   BOOK GALLERY RESPONSIVE: MOBILE
   ======================================== */

@media (max-width: 768px) {
    .book-gallery-container {
        border-radius: 15px;
        height: calc(100vh - 20px);
        display: flex;
        flex-direction: column;
    }

    .book-gallery-container .main-swiper {
        flex: 1;
        min-height: 0;
    }

    .book-gallery-container .main-swiper .swiper-slide {
        padding: 10px;
    }

    .book-gallery-container .swiper-button-next,
    .book-gallery-container .swiper-button-prev {
        width: 40px !important;
        height: 40px !important;
        opacity: 0 !important;
    }

    .book-gallery-container .swiper-button-next::after,
    .book-gallery-container .swiper-button-prev::after {
        font-size: 14px !important;
    }

    .book-gallery-container .thumbnails-container {
        padding: 15px;
        flex-shrink: 0;
    }

    .book-gallery-container .thumbs-swiper .swiper-slide {
        width: 60px;
        height: 85px;
    }

    .book-gallery-container .page-number {
        font-size: 2rem;
    }

    .book-gallery-container .page-title {
        font-size: 0.9rem;
    }
}

/* ========================================
   BOOK GALLERY RESPONSIVE: TABLET
   ======================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    .book-gallery-container {
        height: 80vh;
        display: flex;
        flex-direction: column;
    }

    .book-gallery-container .main-swiper {
        flex: 1;
        min-height: 0;
    }

    .book-gallery-container .main-swiper .swiper-slide {
        padding: 20px;
    }

    .book-gallery-container .book-page,
    .book-gallery-container .page-placeholder {
        max-width: 350px;
        max-height: 495px;
        margin: 0 auto;
        width: auto;
        height: auto;
    }

    .book-gallery-container .thumbnails-container {
        flex-shrink: 0;
    }

    .book-gallery-container .thumbs-swiper .swiper-slide {
        width: 80px;
        height: 113px;
    }
}

/* ========================================
   BOOK GALLERY RESPONSIVE: DESKTOP
   ======================================== */

@media (min-width: 1025px) {
    .book-gallery-container {
        height: 100%;
    }

    .book-gallery-container .main-swiper {
        height: 600px;
    }

    .book-gallery-container .main-swiper .swiper-slide {
        padding: 30px;
    }

    .book-gallery-container .book-page,
    .book-gallery-container .page-placeholder {
        max-width: 424px;
        max-height: 600px;
        margin: 0 auto;
    }

    .book-gallery-container .thumbs-swiper .swiper-slide {
        width: 100px;
        height: 142px;
    }

    .book-gallery-container .page-number {
        font-size: 4rem;
    }

    .book-gallery-container .page-title {
        font-size: 1.2rem;
    }

    .book-gallery-container .swiper-free-mode > .swiper-wrapper {
        justify-content: center;
    }
}

/* ========================================
   FEATURES COMPONENT (Quick Introduction)
   ======================================== */

#quick-introduction-canvas,
#get-to-know-engloset-canvas {
    height: 100% !important;
    max-height: 100% !important;
    padding: 0 !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

#quick-introduction-canvas {
    overflow: hidden;
}

.features-wrapper {
    margin: 50px 50px 73px;
}

.features-container {
    width: 80%;
}

.features-wrapper .header-subtitle {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

.features-wrapper .feature-section {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 25px;
    border-radius: 15px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
    position: relative;
}

.features-wrapper .feature-section.animate {
    opacity: 1;
    transform: translateY(0);
}

.features-wrapper .feature-icon-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    margin-left: 25px;
    border: 1px solid #8dc04e;
    border-radius: 9px;
    background-color: #ffffff;
    flex-shrink: 0;
}

.features-wrapper .dashed-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 100%;
    left: 50%;
}

.features-wrapper .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: #8dc04e;
    margin: 4px 0;
    opacity: 0;
    animation: features-fadeDot 0.4s forwards;
}

@keyframes features-fadeDot {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.features-wrapper .feature-section.animate .dot {
    animation-name: features-fadeDot;
}

.features-wrapper .feature-content {
    display: flex;
    flex-direction: column;
    align-items: start;
    user-select: none;
}

.features-wrapper .feature-title {
    font-size: 18px;
    font-weight: bold;
    color: #3c444f;
    margin-bottom: 10px;
    text-align: -webkit-right;
}

.features-wrapper .feature-description {
    color: #646474;
    line-height: 1.8;
    font-size: 16px;
    text-align: -webkit-right;
}

/* Features Responsive */
@media (max-width: 650px) {
    .features-wrapper {
        margin: 20px;
        padding: unset;
    }

    .features-container {
        width: 100%;
    }
}

@media (max-width: 450px) {
    .features-wrapper .header-subtitle {
        font-size: 16px;
        text-align: center;
        width: 90%;
    }

    .features-wrapper .feature-section {
        align-items: start;
        padding: 10px 0;
        margin-bottom: unset;
    }

    .features-wrapper .feature-icon-wrapper {
        margin-left: 15px;
        width: 60px;
        height: 60px;
    }

    .features-wrapper .feature-content {
        gap: 5px;
    }

    .features-wrapper .feature-title {
        font-size: 14px;
    }

    .features-wrapper .feature-description {
        font-size: 12px;
    }
}

/* ========================================
   ACCESSIBILITY & PERFORMANCE
   ======================================== */

/* RTL Support for Book Gallery */
.book-gallery-container[dir="rtl"] .swiper-button-prev {
    left: var(--swiper-navigation-sides-offset, 10px);
    right: auto;
}

.book-gallery-container[dir="rtl"] .swiper-button-next {
    right: var(--swiper-navigation-sides-offset, 10px);
    left: auto;
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .book-gallery-container .book-page,
    .book-gallery-container .thumb-page {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Focus States for Accessibility */
.book-gallery-container .swiper-button-next:focus,
.book-gallery-container .swiper-button-prev:focus,
.book-gallery-container .thumbs-swiper .swiper-slide:focus {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .book-gallery-container .book-page:hover,
    .book-gallery-container .thumbs-swiper .swiper-slide,
    .book-gallery-container .swiper-button-next,
    .book-gallery-container .swiper-button-prev,
    .guide-wrap .guide-btn,
    .guide-wrap .guide-item {
        transition: none;
    }

    .book-gallery-container .page-placeholder::before {
        animation: none;
    }
}