html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: white;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Main container for centering and max-width */
.page-wrapper {
    width: 100%;
    margin: 0 auto;
    padding: 3vw 2vw 0vw 2vw;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

/* Container for the three main columns */
.main-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2vw;
    flex-grow: 1;
    margin-top: 152px;
    width: 100%;
    max-width: 100%;
    position: relative;
    z-index: 11;
    background: white;
    transition: margin-top 0.4s cubic-bezier(0.4, 0, 0.2, 1), z-index 0s;
}

.main-layout.cover-title {
    margin-top: 0;
    z-index: 20;
}

/* Left panel styling */
.left-panel {
    width: clamp(135px, 12vw, 200px);
    min-width: 135px;
    max-width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Center content area styling */
.center-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60vw;
    min-width: 320px;
    max-width: 70vw;
}

.center-content>.bottom-nav+div+.center-footer {
    /* Target the footer after the navigation and spacer specifically */
    margin-top: 30px !important;
}

/* Right panel styling */
.right-panel {
    width: 14vw;
    min-width: 140px;
    max-width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Custom styles to ensure proper layout - KEEPING THESE FOR NOW */
.section {
    margin-bottom: 8px;
    width: 100%;
    text-align: center;
}

.curved-img {
    width: clamp(120px, 10vw, 150px);
    height: auto;
    margin-bottom: 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.instructions-text {
    font-size: clamp(9px, 0.7vw, 9px);
    text-align: center;
    font-family: 'Config Rounded', sans-serif;
    color: black;
    margin: 0 auto 8px auto;
    padding: 0 5px;
    line-height: 1.3;
    max-width: 180px;
    display: block;
    width: 100%;
}

.instructions-text.expanded {
    margin-bottom: 20px;
}

.circle-rectangle {
    display: flex;
    justify-content: space-around;
    width: clamp(120px, 10vw, 180px);
    margin: 8px auto 0;
}

.option {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: clamp(45px, 3.5vw, 70px);
}

.circle-shape {
    width: clamp(40px, 3vw, 60px);
    height: clamp(40px, 3vw, 60px);
    background-color: rgb(212, 212, 216);
    border-radius: 50%;
    margin-bottom: 4px;
}

.rectangle-shape {
    width: clamp(35px, 2.7vw, 55px);
    height: clamp(40px, 3vw, 60px);
    background-color: rgb(212, 212, 216);
    margin-bottom: 4px;
}

.option-text {
    font-size: clamp(9px, 0.9vw, 16px);
    max-width: clamp(180px, 14vw, 260px);
    margin: 0 auto 4px auto;
    text-align: center;
    font-family: 'Config Rounded', sans-serif;
    color: black;
    line-height: 1.3;
}

/* Filter sections styling */
.filter-section {
    width: 100%;
    margin-bottom: 8px;
    text-align: center;
}

.filter-title {
    font-family: 'Swanky and Moo Moo', cursive;
    font-size: clamp(16px, 1.3vw, 24px);
    margin-bottom: 0.5vw;
}

.filter-desc {
    font-size: clamp(9px, 0.7vw, 9px);
    max-width: 150px;
    margin: 0 auto 4px auto;
    text-align: center;
    font-family: 'Config Rounded', sans-serif;
    color: black;
    line-height: 1.3;
}

.blue-circle,
.red-circle {
    width: clamp(40px, 3.5vw, 65px);
    height: clamp(40px, 3.5vw, 65px);
    border-radius: 50%;
    margin: 0 auto 8px auto;
}

.blue-circle {
    background-color: #0000FF;
}

.red-circle {
    background-color: #FF0000;
}

.filter-slider {
    width: 100%;
    margin-top: 8px;
}

.slider-line {
    width: 120px;
    height: 3px;
    background-color: black;
    position: relative;
    margin: 15px auto 0;
    border-radius: 1.5px;
    --fill: 30px;
}

.slider-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--fill);
    background-color: rgb(255, 000, 000);
    border-radius: 1.5px;
    transition: width 0.1s ease-out;
}

.slider-thumb {
    width: 14px;
    height: 14px;
    background-color: white;
    border: 2px solid black;
    border-radius: 50%;
    position: absolute;
    top: -5.5px;
    left: calc(var(--fill) - 7px);
    cursor: pointer;
    transition: left 0.1s ease-out;
    z-index: 5;
}

.blue-text {
    color: #1d4ed8;
}

.red-text {
    color: red;
}

/* Navigation List Styling */
#nav-list {
    width: 9vw;
    min-width: 90px;
    max-width: 133px;
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 0;
    /* Spacing handled by parent gap */
}

.nav-item-link {
    display: block;
    width: 100%;
    text-decoration: none;
    padding: 0;
}

.nav-item-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.nav-item-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
    margin: 3px 0;
    position: relative;
    width: 100%;
}

.nav-line {
    width: 100%;
    display: block;
}

.nav-icon-left {
    height: 20px;
    width: auto;
    margin-right: 5px;
    flex-shrink: 0;
}

.nav-item-content span {
    margin-right: auto;
}

.nav-icon-right {
    height: 15px;
    width: auto;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    flex-shrink: 0;
}

/* Submit Section Styling */
.submit-section {
    width: 12vw;
    min-width: 120px;
    max-width: 200px;
    margin-top: -1.2vw;
    position: relative;
    z-index: 2;
}

#submit-section>*:not(.submit-title-img) {
    display: none;
}

.submit-title-img {
    margin-bottom: -18px;
    margin-top: 0px;
    width: 11vw;
    min-width: 110px;
    max-width: 170px;
    height: auto;
    position: relative;
    z-index: 3;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.text-area-container {
    margin-top: 0;
    width: 100%;
    max-width: 180px;
    height: 8vw;
    min-height: 80px;
    max-height: 120px;
    position: relative;
}

.text-area-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.2));
}

.submit-textarea {
    position: relative;
    z-index: 2;
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    padding: 14px 10px 10px 10px;
    background-color: transparent;
    border: none;
    resize: none;
    font-family: 'Config Rounded', sans-serif;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.7);
}

.submit-textarea:focus {
    outline: none;
}

.submit-textarea::placeholder {
    color: rgba(0, 0, 0, 0.7);
    font-family: 'Config Rounded', sans-serif;
    font-size: 10px;
}

.submit-button-img {
    width: 100%;
    display: block;
    margin: 8px auto 0 auto;
    cursor: pointer;
    filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.25));
}

.believe-text {
    font-size: 1.5vw;
    font-family: 'Swanky and Moo Moo', cursive;
    color: black;
    text-align: center;
    display: block;
    margin: 16px auto 0 auto;
}

/* Collapsible panels default-closed - Keep this logic */
.left-panel .section>*:not(.curved-img) {
    display: none;
}

/* Narrow the Filter Size bubble */
#filter-size-section .curved-img {
    width: 130px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Adjust vertical spacing between left panels */
#filter-shape-section {
    margin-top: -18px;
}

#filter-size-section {
    margin-top: -10px;
}

/* --- Styles for moved/new elements --- */
.title-block {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    z-index: 10;
    background: white;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 35px;
}

.title-main {
    text-align: center;
    color: black;
    font-size: 3.8vw;
    font-family: 'Swanky and Moo Moo', cursive;
    line-height: 1;
    margin-bottom: 0;
}

.sub-headline {
    text-align: center;
    margin-top: 0;
    font-family: 'Swanky and Moo Moo', cursive;
    font-size: 2.8vw;
    line-height: 1;
}

.sub-headline span {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.sub-headline .text-blue-700 {
    color: blue;
}

/* Keep colors */
.sub-headline .text-red-600 {
    color: red;
}

.description {
    text-align: center;
    color: black;
    font-size: clamp(12px, 1vw, 0.9vw);
    font-family: 'Config Rounded', sans-serif;
    font-weight: 400;
    margin-top: 0.5vw;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    max-width: none;
}

/* Main content area (comic pages) */
.comic-pages {
    width: 100%;
    max-width: 60vw;
    min-width: 320px;
    aspect-ratio: 998 / 686;
    background-color: white;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.comic-pages.with-shadow {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Flipbook styles */
.flipbook {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    overflow: hidden;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: white;
    transition: margin 0.3s ease;
}

.flipbook div {
    background-color: transparent;
}

.flipbook div img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background-color: transparent;
    pointer-events: none;
}

/* Turn.js specific styles */
.turn-page {
    background-color: transparent !important;
}

.turn-page-wrapper {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    background-color: transparent !important;
}

/* Styles for single page view (covers) */
.turn-page-wrapper.p1,
.turn-page-wrapper.p16 {
    margin: 0 auto !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden;
}

/* Style for double page view */
.turn-page-wrapper.even:not(.p1):not(.p16) {
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1) !important;
    border-right: none !important;
}

.turn-page-wrapper.odd:not(.p1):not(.p16) {
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1) !important;
    border-left: none !important;
}

/* Ensure proper page alignment in double spread */
.turn-page-wrapper.even:not(.p1):not(.p16) .page {
    float: right !important;
}

.turn-page-wrapper.odd:not(.p1):not(.p16) .page {
    float: left !important;
}

/* Force proper overflow behavior for smooth turning */
.turn-page-wrapper {
    overflow: hidden !important;
}

/* Ensure shadow effect works properly */
.turn-shadow {
    background-color: rgba(0, 0, 0, 0.3) !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    opacity: 0.5;
}

/* Double page specific styles */
.flipbook[display="double"] div,
.flipbook[display="double"] .turn-page-wrapper {
    background-color: white !important;
}

.flipbook[display="double"] .turn-page-wrapper.odd {
    border-left: none !important;
}

.flipbook[display="double"] .turn-page-wrapper.even {
    border-right: none !important;
}

/* Single page specific styles */
.flipbook[display="single"] div {
    margin: 0 auto !important;
}

.flipbook[display="single"] .turn-page-wrapper {
    margin: 0 auto !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2) !important;
    border-radius: 5px;
    overflow: hidden;
}

/* Fixed even-odd page issue in turn.js */
.turn-page {
    background-color: white !important;
}


/* Bottom Navigation Area */
.bottom-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2vw;
    margin-top: 2vw;
    width: 100%;
    margin-bottom: 10px;
}

.nav-button img {
    height: 2.5vw;
    min-height: 25px;
    width: auto;
}

.bottom-nav .text-center {
    color: black;
    font-size: 0.8vw;
    font-family: 'Config Rounded', sans-serif;
    font-weight: 400;
}

/* Footer Text - when centered within nav area */
.center-footer {
    text-align: center;
    color: rgb(113 113 122);
    font-size: 0.8vw;
    font-family: 'Config Rounded', sans-serif;
    font-weight: 400;
    margin: 10px auto 20px auto;
    padding: 0;
    width: auto;
    min-width: 0;
    display: block;
    position: relative;
}

.center-content>.bottom-nav+.center-footer {
    /* Updated selector to match new structure without spacer div */
    margin-top: 10px !important;
    margin-bottom: 20px !important;
}

/* Original Footer Text styles - keeping for reference */
.footer {
    text-align: center;
    margin-top: auto;
    padding: 20px 0 10px;
    width: 100%;
}

.footer-text {
    width: 30vw;
    min-width: 200px;
    max-width: 516px;
    text-align: center;
    color: rgb(113 113 122);
    font-size: 0.8vw;
    font-family: 'Config Rounded', sans-serif;
    font-weight: 400;
    margin: 0 auto;
}

#nav-heading {
    width: 10vw;
    min-width: 140px;
    max-width: 160px;
    position: relative;
    z-index: 1;
}

#nav-heading .curved-img {
    width: 100%;
    height: auto;
}

/* Responsive breakpoints */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
        align-items: center;
    }

    .left-panel,
    .right-panel {
        flex-direction: row;
        width: 100%;
        max-width: 100vw;
        justify-content: center;
    }

    .center-content,
    .title-block,
    .comic-pages {
        max-width: 90vw;
        width: 90vw;
    }

    .curved-img {
        width: 14vw;
    }

    .circle-rectangle {
        width: 14vw;
    }

    .center-footer {
        font-size: 1.2vw;
        margin-top: 10px !important;
        margin-bottom: 20px !important;
        padding-top: 0 !important;
    }
}

@media (max-width: 600px) {
    .page-wrapper {
        padding: 1vw;
    }

    .main-layout {
        gap: 1vw;
    }

    .left-panel,
    .right-panel {
        min-width: 60px;
        max-width: 100vw;
    }

    .center-content,
    .title-block,
    .comic-pages {
        max-width: 98vw;
        width: 98vw;
    }

    .footer-text {
        width: 90vw;
    }

    .center-footer {
        font-size: 2vw;
        margin-top: 10px !important;
        margin-bottom: 15px !important;
        padding-top: 0 !important;
    }

    .curved-img {
        width: 20vw;
    }

    .circle-rectangle {
        width: 20vw;
    }
}

@font-face {
    font-family: 'Config Rounded';
    src: url('./Fonts/ConfigRoundedRegular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Config Rounded';
    src: url('./Fonts/ConfigRoundedBold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Config Rounded';
    src: url('./Fonts/ConfigRoundedItalic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

.submit-form-block {
    width: 100%;
    max-width: 180px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.text-area-container,
.submit-button-img {
    width: 100%;
}

/* Draggable Filter Lenses */
.lens {
    position: absolute;
    z-index: 9999;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    display: none;
    transition: border-radius 0.2s;
    opacity: 1;
    touch-action: none;
    /* Prevent browser touch actions */
    -webkit-user-select: none;
    /* Safari */
    -ms-user-select: none;
    /* IE/Edge */
    user-select: none;
    /* Standard syntax */
    will-change: transform;
    /* Optimize for animations */
}

.lens-blue {
    background: rgb(0, 0, 255);
    mix-blend-mode: multiply;
}

.lens-red {
    background: rgb(255, 0, 0);
    mix-blend-mode: multiply;
}

.lens-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: transparent;
    cursor: pointer;
    z-index: 10001;
    /* Make close button easier to tap on mobile */
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0;
}

.lens-close-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.selected-shape {
    border: 1px solid #FF0000;
    box-sizing: border-box;
}

.highlight-red {
    border: 1px solid #FF0000 !important;
    box-sizing: border-box;
}


.title-block-hidden {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0 !important;
    padding: 0 !important;
}

.page-wrapper.top-gap {
    padding-top: 32px;
}

.next-story-page {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1);
    z-index: 20;
}

#nextStoryBtn,
#nextStoryBtnClosed,
.responses-button {
    font-family: 'Swanky and Moo Moo', cursive;
    font-size: 0.9vw;
    padding: 0.3vw 0.9vw;
    border-radius: 8px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
}

/* Mobile-specific font size for buttons */
@media only screen and (max-width: 767px) {

    #nextStoryBtn,
    #nextStoryBtnClosed,
    .responses-button {
        font-size: 2.2vw !important;
        padding: 0.6vw 1.5vw !important;
    }
}

#nextStoryBtn span,
#nextStoryBtnClosed span,
.responses-button span {
    display: inline-block;
    vertical-align: middle;
    margin-left: 2px;
    line-height: 1;
    position: relative;
    top: 1px;
}

#nextStoryBtn:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

#nextStoryBtnClosed:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.responses-button:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.closed-book-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    z-index: 30;
    background: white;
}

.closed-book-left, .closed-book-right {
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Centered closed book for final story */
.closed-book-centered {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.closed-book-img {
    max-width: 80%;
    max-height: 80%;
    display: block;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.10);
}

/* Cover page specific styling */
.cover-page {
    position: relative;
    box-sizing: border-box;
    /* Ensure the cover page has proper dimensions */
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    /* Remove flex which may be causing positioning issues */
    display: block;
    /* Remove direct border as it conflicts with page curl */
    border: none;
    /* Create a better solution for frames that won't be affected by page curl */
    position: relative;
}

/* Create separate frame elements that won't be affected by page curl */
.cover-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 100;
}

.cover-page img {
    /* Ensure image fits within the container without adding additional borders */
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    box-sizing: border-box;
    /* Remove the border from the image itself */
    border: none;
    margin: 0;
    padding: 0;
    /* Prevent any overflow issues */
    max-width: 100%;
    max-height: 100%;
}

/* Style for the first page (cover) in Turn.js */
.p1 {
    overflow: visible !important;
}

/* Force border on turn.js content as well */
.turn-page-wrapper.p1,
.turn-page-wrapper .cover-page {
    border: none !important;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* Use box-shadow to create frame effect that's independent of page curl */
.turn-page-wrapper.p1::before,
.turn-page-wrapper .cover-page::before,
.turn-page-wrapper .page-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 1000;
}

.turn-page-wrapper.p1 .page-content img,
.turn-page-wrapper .cover-page img {
    /* Remove individual borders from images inside Turn.js wrappers */
    border: none !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Extra override for turn.js shadow elements */
.turn-page.p1,
.turn-page.odd,
.turn-page.even {
    box-shadow: none !important;
    /* Remove default Turn.js shadows */
}

/* Override for turn.js elements to ensure border remains visible */
.turn-page-wrapper:hover .cover-page::before,
.turn-page-wrapper:hover::before,
.turn-page-wrapper:hover .page-content::before {
    z-index: 1000 !important;
    /* Ensure our border stays on top during hover */
}

/* Add responsive styles for filter elements on mobile */
@media (max-width: 768px) {

    .blue-circle,
    .red-circle {
        /* Make filter circles easier to tap on mobile */
        width: clamp(50px, 7vw, 85px);
        height: clamp(50px, 7vw, 85px);
    }

    .slider-thumb {
        /* Make slider thumb bigger for easier touch */
        width: 18px;
        height: 18px;
        top: -7.5px;
    }

    .lens-close {
        /* Make close button more tappable on mobile */
        width: 28px;
        height: 28px;
        line-height: 28px;
        font-size: 20px;
    }

    /* Improve instructions text readability on mobile */
    .filter-desc {
        font-size: clamp(10px, 0.9vw, 12px);
        max-width: 90%;
    }

    /* Ensure lenses don't exceed screen bounds on small devices */
    .lens {
        max-width: 80vw;
        max-height: 80vw;
    }
}

/* iOS specific styles for better touch handling */
body.ios-device {
    /* Prevent unwanted scrolling/zooming during lens drag */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body.ios-dragging {
    /* Completely disable scrolling while dragging on iOS */
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Enhanced styles for lenses on iOS */
.ios-lens {
    /* Better performance on iOS devices */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Prevent iOS text selection during drag operations */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;

    /* Additional properties to help with smooth movement */
    will-change: transform, left, top;

    /* Prevent highlighting on tap */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

    /* Increase touch target size slightly */
    padding: 2px;
    margin: -2px;

    /* Ensure mix-blend-mode works on iOS */
    isolation: isolate;
}

/* Make lens close button easier to tap on iOS */
.ios-lens .lens-close {
    /* Increase the touch target size without changing appearance */
    min-width: 30px;
    min-height: 30px;
    width: 30px;
    height: 30px;
    background: transparent;
}

.ios-lens .lens-close-img {
    width: 70%;
    height: 100%;
    object-fit: contain;
}

/* iPad specific styles */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {

    /* Optimize slider for iPad */
    .slider-thumb {
        width: 20px;
        height: 20px;
        top: -8.5px;
    }

    /* Make lens sizes more appropriate for iPad screen */
    .lens {
        min-width: 100px;
        min-height: 100px;
    }

    /* Prevent unwanted touch events on iPad */
    .comic-pages {
        touch-action: pan-x pan-y;
    }

    /* Make filter circles more visible on iPad */
    .blue-circle,
    .red-circle {
        width: 60px;
        height: 60px;
    }

    /* Improve text size for iPad */
    .filter-desc {
        font-size: 12px;
    }
}

/* Fix for iOS Safari issues with fixed positioning */
@supports (-webkit-touch-callout: none) {
    .lens {
        /* Use hardware acceleration for smoother movement on iOS */
        transform: translate3d(0, 0, 0);
    }

    /* Prevent rubber-banding scroll effect from interfering with lens dragging */
    body.ios-dragging * {
        touch-action: none !important;
    }
}

/* Mobile phone specific styles */
@media only screen and (max-width: 767px) {
    /* Mobile styles moved to mobile.css */
    /* This media query intentionally left empty */

    /* Ensure cover frame is visible on mobile, with slightly thinner effect */
    .cover-page::before,
    .turn-page-wrapper.p1::before,
    .turn-page-wrapper .cover-page::before {
        box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.8);
    }

    /* Make sure images fill the container without additional borders */
    .cover-page img,
    .turn-page-wrapper.p1 .page-content img,
    .turn-page-wrapper .cover-page img {
        border: none !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0;
        padding: 0;
    }

    /* Make lens close button bigger on mobile for easier tapping */
    .lens-close {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        top: 8px;
        right: 8px;
        background: transparent;
    }

    /* Ensure the image inside the close button fills the container */
    .lens-close-img {
        width: 70%;
        height: 100%;
        object-fit: contain;
    }
}

/* Desktop-only media query */
@media only screen and (min-width: 768px) {
    /* Desktop styles remain unchanged */
    /* This ensures all elements remain visible on desktop as originally designed */

    /* Add min-height for desktop only */
    .page-wrapper {
        min-height: 100vh;
    }

    /* Hide mobile elements on desktop */
    .mobile-burger-menu,
    .mobile-slide-menu {
        display: none !important;
    }
}

/* Mobile-specific menu styles moved to mobile.css */

/* Author Credit Link and Popup Styles */
.author-credit-link {
    color: blue;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    display: inline-block;
    padding: 2px 4px;
}

.author-credit-link:hover {
    color: blue;
    text-decoration: underline;
    opacity: 0.8;
}

.author-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
}

.author-popup.active {
    visibility: visible;
    opacity: 1;
}

.author-card {
    background: black;
    width: 90%;
    max-width: 350px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s;
    padding: 20px 15px 25px;
}

.author-popup.active .author-card {
    transform: scale(1);
}

.author-card-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 25px;
}

.author-title {
    font-family: 'Swanky and Moo Moo', cursive;
    font-size: 28px;
    color: white;
    margin: 0 0 2px;
    width: 100%;
    text-align: center;
}

.author-subtitle {
    font-family: 'Config Rounded', sans-serif;
    font-size: 12px;
    color: #cccccc;
    margin: 0;
    font-weight: normal;
}

.author-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    filter: invert(1);
}

.author-close-btn:hover {
    opacity: 1;
}

.author-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: center;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
}

.contact-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white !important;
}

.author-social {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
    margin-top: 5px;
}

/* Social links styling */
.social-link {
    font-family: 'Config Rounded', sans-serif;
    font-size: 14px;
    color: #fff;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 80%;
    padding: 6px 10px;
    border-radius: 6px;
}

.social-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.social-link span {
    margin-left: 8px;
}

/* All icons consistent color */
.fa-instagram, .fa-linkedin, .fa-envelope {
    color: white !important;
}

/* Responsive styles for the author popup */
@media only screen and (max-width: 767px) {
    .author-card {
        width: 85%;
        max-width: 320px;
    }

    .author-title {
        font-size: 24px;
    }

    .social-link {
        width: 90%;
    }
}