/* Mobile Styles - Separated from main.css */

/* Mobile Burger Menu and Slide Out Menu Styles */
.mobile-burger-menu {
    display: block !important;
    position: fixed !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 1000 !important;
    width: 40px !important;
    height: 40px !important;
    cursor: pointer !important;
}

.burger-menu-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    transition: transform 0.3s ease !important;
}

.mobile-burger-menu.active .burger-menu-img {
    opacity: 0 !important;
}

/* Mobile Slide Out Menu Styles */
.mobile-slide-menu {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999 !important;
    transition: right 0.3s ease-in-out !important;
    pointer-events: none !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
    padding-top: 0 !important;
}

body.mobile-menu-open .mobile-slide-menu {
    right: 0 !important;
    pointer-events: auto !important;
}

/* iOS-specific styles to prevent rendering artifacts */
.ios-device .mobile-instructions {
    transition: opacity 0.2s ease !important;
    will-change: opacity, transform !important;
    transform: translateZ(0) !important;
    /* Force GPU acceleration */
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

.ios-device .mobile-slide-menu {
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
}

.ios-device .mobile-filter-panel {
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
}

.slide-menu-content {
    position: relative !important;
    width: 210px !important;
    /* Wider menu */
    height: 490px !important;
    /* Fixed height to match the red line in your reference */
    min-height: 0 !important;
    max-height: none !important;
    /* Remove max-height constraint */
    background-image: url('./images/menu-out.png') !important;
    background-size: 100% 100% !important;
    /* Stretch the background image to fill container */
    background-repeat: no-repeat !important;
    background-position: right top !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin-right: -15px !important;
    margin-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Content wrapper to align items inside the background image */
.slide-menu-inner {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    /* Distribute space between elements */
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Close button styles */
.close-menu-btn {
    position: absolute !important;
    top: 15px !important;
    right: 25px !important;
    width: 18px !important;
    height: 18px !important;
    cursor: pointer !important;
    z-index: 1001 !important;
}

.close-menu-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* Description text styling */
.menu-description {
    font-family: 'Config Rounded', sans-serif !important;
    font-size: 9px !important;
    color: black !important;
    text-align: center !important;
    margin-top: 50px !important;
    width: 75% !important;
    line-height: 1.3 !important;
    margin-bottom: 10px;
    /* margin-bottom: 15px !important; */
}

/* Menu wrapper to properly position items and footer */
.mobile-menu-items {
    width: 65% !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    gap: 0 !important;
    margin: 0 auto !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    position: relative !important;
}

/* Remove the spacer that was pushing content apart */
.mobile-menu-items::after {
    content: none !important;
}

/* ALL menu items - base styling */
.mobile-menu-item {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    position: relative !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    margin: -2px auto !important;
    /* Increase negative margin to bring items closer */
}

/* Menu images - consistent sizing */
.mobile-menu-img {
    max-width: 120px !important;
    /* Changed from 130px to 107px as requested */
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Custom menu images styling for new images */
.custom-menu-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 120px !important;
    /* Changed from 'none' to 107px to match other menu items */
    object-fit: contain !important;
}

/* Completely reposition toggle buttons absolutely 
   without affecting the centering of menu items */
.toggle-img {
    width: 35px !important;
    height: 35px !important;
    object-fit: contain !important;
    position: absolute !important;
    left: -25px !important;
    /* Position outside the menu item container */
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
}

/* Black circle - update spacing and max-width */
.mobile-menu-item.black-circle {
    margin: -15px auto 0 !important;
    /* Adjust black circle margin to maintain proper spacing */
}

/* Special styling for black circle image */
.mobile-menu-item.black-circle .mobile-menu-img {
    max-width: 153px !important;
    margin-bottom: 15px !important;
}

/* Mobile filter panels styling */
.mobile-filter-panel {
    width: 90% !important;
    margin: 0 auto 2px auto !important;
    padding: 5px !important;
    background-color: rgba(255, 255, 255, 0.85) !important;
    border-radius: 15px !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
}

/* Instructions panel specific styles */
.mobile-instructions {
    width: 100% !important;
    padding: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    position: absolute !important;
    z-index: 20 !important;
    top: 35px !important;
    /* Adjust top position to match new spacing */
    left: 0 !important;
    margin: 0 !important;
}

.instructions-content {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background-color: transparent !important;
    padding: 0 !important;
}

.instructions-img {
    width: 100% !important;
    max-width: 190px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: -2px 0 0 !important;
    display: block !important;
    transform: scale(1.07) !important;
}

/* Add any other styles needed for filter components here */
.mobile-filter-title {
    font-family: 'Swanky and Moo Moo', cursive !important;
    font-size: 18px !important;
    margin-bottom: 10px !important;
    text-align: center !important;
}

/* Menu footer styles - position at end of content */
.menu-footer {
    font-family: 'Config Rounded', sans-serif !important;
    font-size: 8px !important;
    color: #666 !important;
    text-align: center !important;
    margin-top: 10px !important;
    margin-bottom: 30px !important;
    /* Provide space at the bottom */
    width: 70% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    position: relative !important;
    align-self: center !important;
}

/* Mobile menu author credit link styling */
.menu-footer .author-credit-link {
    font-size: 8px !important;
    color: blue !important;
    text-decoration: underline !important;
    padding: 3px !important;
    display: inline-block !important;
    cursor: pointer !important;
    transition: opacity 0.2s ease !important;
}

.menu-footer .author-credit-link:hover {
    opacity: 0.8 !important;
}

/* Mobile-specific media queries */
@media only screen and (min-width: 768px) {

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

@media only screen and (max-width: 767px) {

    /* Hide desktop elements on mobile */
    #instructions-section,
    #filter-shape-section,
    #filter-size-section,
    .filter-section,
    #nav-heading,
    #nav-list,
    .navigation,
    #submit-section {
        display: none !important;
    }

    /* Also hide the subtitle/description text on phones */
    .description {
        display: none !important;
    }

    /* Adjust title block position and spacing on mobile */
    .title-block {
        position: relative !important;
        margin-top: 60px !important;
        padding-top: 10px !important;
        z-index: 5 !important;
    }

    /* Make the main title bigger on mobile */
    .title-main {
        font-size: 36px !important;
        line-height: 33px !important;
        margin-bottom: 5px !important;
    }

    /* Make the subtitle bigger and improve spacing on mobile */
    .sub-headline {
        font-size: 22px !important;
        line-height: 20px !important;
        margin-top: 5px !important;
        margin-bottom: 10px !important;
    }

    /* Adjust main layout to account for the repositioned title */
    .main-layout {
        margin-top: 30px !important;
    }

    /* Optimize comic pages for mobile view */
    .comic-pages {
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Center content section */
    .center-content {
        width: 100% !important;
        max-width: 100% !important;
        padding-bottom: 0 !important;
    }

    /* Remove min-height for page wrapper on mobile */
    .page-wrapper {
        min-height: 0 !important;
        /* Override the 100vh min-height */
    }

    /* Hide the bottom author credit on mobile */
    .footer-text.center-footer {
        display: none !important;
    }

    /* Bottom navigation text size for mobile */
    .bottom-nav .text-center {
        font-size: 2vw !important;
    }
}

/* Mobile Page Filter Panels (Below Comic) */
.mobile-page-filter-panels {
    display: none !important;
    /* Hidden on desktop */
    width: 100% !important;
    margin: 15px auto !important;
    padding: 0 15px !important;
}

/* NEW: Mobile Page Filter Grid Layout */
.mobile-page-filter-grid {
    display: flex !important;
    justify-content: space-around !important;
    align-items: flex-start !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: transparent !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure the columns display side by side properly */
.mobile-page-filter-column {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    flex-basis: 48% !important;
    gap: 0px !important;
}

/* Remove the forced display for colors column to allow JavaScript control */


.mobile-page-filter {
    margin-bottom: 0px !important;
    text-align: center !important;
    padding: 5px !important;
    border-radius: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    width: 100% !important;
}

.mobile-page-filter-title {
    font-family: 'Swanky and Moo Moo', cursive !important;
    font-size: 16px !important;
    /* Smaller title */
    margin-bottom: 8px !important;
    /* Reduced margin */
    text-align: center !important;
    color: #000 !important;
}

/* Filter Shape Options */
.mobile-page-shape-options {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    margin-top: 5px !important;
    width: 100% !important;
}

.mobile-page-option {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    cursor: pointer !important;
}

.mobile-page-circle-shape {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50% !important;
    background-color: #dcdcdc !important;
    margin-bottom: 5px !important;
    transition: all 0.2s ease !important;
}

/* Updated rectangle shape with proper aspect ratio */
.mobile-page-rectangle-shape {
    width: clamp(35px, 2.7vw, 55px) !important;
    height: clamp(40px, 3vw, 60px) !important;
    background-color: #dcdcdc !important;
    margin-bottom: 5px !important;
    transition: all 0.2s ease !important;
}

.mobile-page-option-text {
    font-size: 12px !important;
    /* Smaller text */
    font-family: 'Config Rounded', sans-serif !important;
    color: #000 !important;
}

/* Filter Size Slider */
.mobile-page-filter-slider {
    width: 100% !important;
    margin-top: 5px !important;
    /* Reduced margin */
}

.mobile-page-slider-line {
    width: 45% !important;
    height: 3px !important;
    background-color: black !important;
    position: relative !important;
    margin: 10px auto 0 !important;
    border-radius: 1.5px !important;
    --fill: 30px !important;
}

.mobile-page-slider-line::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    height: 100% !important;
    width: var(--fill) !important;
    /* Width in pixels matching desktop approach */
    background-color: rgb(255, 0, 0) !important;
    border-radius: 1.5px !important;
    transition: width 0.05s linear !important;
    /* Faster transition for smoother dragging */
}

.mobile-page-slider-thumb {
    width: 16px !important;
    /* Smaller thumb */
    height: 16px !important;
    /* Smaller thumb */
    background-color: white !important;
    border: 2px solid black !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: -6.5px !important;
    /* Adjusted position */
    left: calc(var(--fill) - 8px) !important;
    /* Automatically position thumb based on fill (half of thumb width) */
    cursor: pointer !important;
    transition: left 0.1s ease-out !important;
    z-index: 5 !important;
    /* Enhanced styling for better interaction */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    touch-action: none !important;
    /* Prevent default touch actions */
}

/* Fix for desktop hover effect */
.mobile-page-slider-thumb:hover {
    cursor: grab !important;
    transform: scale(1.1) !important;
}

/* Active state when dragging */
.mobile-page-slider-thumb:active {
    cursor: grabbing !important;
    transform: scale(1.1) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3) !important;
}

/* Filter Colors */
.mobile-page-filter-section {
    /* This class is no longer used as a wrapper, individual filters are .mobile-page-filter */
    margin-bottom: 10px !important;
    /* Reduced spacing if needed, but individual filters have margin now */
    text-align: center !important;
}

.mobile-page-filter-desc {
    font-size: 11px !important;
    /* Smaller text */
    max-width: 90% !important;
    /* Allow more width */
    margin: 5px auto 8px auto !important;
    /* Adjusted margins */
    font-family: 'Config Rounded', sans-serif !important;
    color: #000 !important;
    line-height: 1.3 !important;
}

.mobile-page-blue-circle,
.mobile-page-red-circle {
    width: 55px !important;
    height: 55px !important;
    border-radius: 50% !important;
    margin: 5px auto !important;
    /* Reduced from 10px to 5px */
    cursor: pointer !important;
    transition: transform 0.2s ease !important;
}

.mobile-page-blue-circle:hover,
.mobile-page-red-circle:hover {
    transform: scale(1.1) !important;
}

.mobile-page-blue-circle {
    background-color: #0000FF !important;
}

.mobile-page-red-circle {
    background-color: #FF0000 !important;
}

/* Highlight styles for page filter shape selection - reduced from 2px to 1px */
.mobile-page-circle-shape.highlight-red,
.mobile-page-rectangle-shape.highlight-red {
    box-shadow: 0 0 0 1px #FF0000 !important;
    /* Reduced from 2px to 1px */
}

.mobile-page-circle-shape.highlight-blue,
.mobile-page-rectangle-shape.highlight-blue {
    box-shadow: 0 0 0 1px #0000FF !important;
    /* Reduced from 2px to 1px */
}

/* Ensure the grid is only shown on mobile */
@media only screen and (min-width: 768px) {
    .mobile-page-filter-grid {
        display: none !important;
    }
}

@media only screen and (max-width: 767px) {
    .mobile-page-filter-panels {
        /* This class is now deprecated by mobile-page-filter-grid */
        display: none !important;
        /* Ensure old wrapper is hidden if it exists */
    }

    .mobile-page-filter-grid {
        display: flex !important;
        /* Ensure it is flex on mobile */
        margin: 0 !important;
        padding: 0 !important;
    }

    /* ... other mobile specific styles ... */
}

/* Ensure all elements in the filter grid have no bottom margin */
.mobile-page-filter-blue,
.mobile-page-filter-red,
.mobile-page-filter-size,
.mobile-page-filter-shape {
    margin-bottom: 0 !important;
}

/* Add a style to make sure there's no purple background */
.main-layout {
    margin-bottom: 0 !important;
}

/* Ensure the center-content has no bottom padding or margin */
.center-content {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

@media only screen and (max-width: 767px) {
    .mobile-page-filter-grid {
        display: flex !important;
        /* Ensure it is flex on mobile */
        margin: 0 !important;
        /* Ensure no margin */
        padding: 0 !important;
        /* Ensure no padding */
    }

    /* Ensure your page wrapper has no bottom padding */
    .page-wrapper {
        padding-bottom: 0 !important;
    }
}

/* Ensure instructions panel appears above other items */
.mobile-filter-panel.mobile-instructions {
    position: absolute !important;
    z-index: 20 !important;
}

/* Ensure the instructions menu item has proper positioning context */
.mobile-menu-item[data-target="mobile-instructions"] {
    position: relative !important;
}

/* Mobile Navigation Panel */
.mobile-navigation-panel {
    width: 100% !important;
    padding: 0 !important;
    background-color: transparent !important;
    position: absolute !important;
    z-index: 20 !important;
    top: 35px !important;
    left: 0 !important;
    margin: 0 !important;
}

.mobile-nav-list {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1px !important;
    padding: 0 !important;
    margin: 0 !important;
}

.mobile-nav-line {
    width: 100% !important;
    height: auto !important;
    margin: 2px 0 !important;
    /* Added vertical margin to increase space between items */
    display: block !important;
}

.mobile-nav-item-link {
    width: 100% !important;
    text-decoration: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 2px 0 !important;
    /* Added vertical padding to make items taller */
}

.mobile-nav-item-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 24px !important;
    /* Added minimum height to ensure consistent height */
}

.mobile-nav-icon-left {
    width: 22px !important;
    height: auto !important;
    margin-right: 12px !important;
}

.mobile-nav-icon-right {
    width: 17px !important;
    height: auto !important;
    margin-left: 5px !important;
}

.mobile-nav-text {
    font-family: 'Swanky and Moo Moo', cursive !important;
    font-size: 16px !important;
    color: black !important;
    flex-grow: 1 !important;
    text-align: left !important;
    line-height: 1.5 !important;
    /* Increased line height for taller text */
}

/* Mobile Submit Panel */
.mobile-submit-panel {
    width: 100% !important;
    padding: 0 !important;
    background-color: transparent !important;
    position: absolute !important;
    z-index: 25 !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.mobile-submit-content {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px 0 !important;
}

.mobile-text-area-container {
    position: relative !important;
    width: 90% !important;
    margin: 0 auto 25px !important;
}

.mobile-text-area-bg {
    width: 100% !important;
    display: block !important;
    border-radius: 4px !important;
    filter: drop-shadow(0px 3px 3px rgba(0, 0, 0, 0.2));
    scale: 1.2;
}

.mobile-submit-textarea {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 96% !important;
    height: 88% !important;
    padding: 10px !important;
    background: transparent !important;
    border: none !important;
    font-size: 9px !important;
    color: #555 !important;
    resize: none !important;
    font-family: 'Config Rounded', sans-serif !important;
    outline: none !important;
}

.mobile-submit-textarea:focus {
    outline: none !important;
    border: none !important;
}

.mobile-submit-button-container {
    width: 90% !important;
    margin: 0 auto 15px !important;
    display: flex !important;
    justify-content: center !important;
}

.mobile-submit-button-img {
    width: 100% !important;
    height: auto !important;
    filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.2)) !important;
    cursor: pointer !important;
    scale: 1.2;
}

.mobile-believe-text {
    font-family: 'Swanky and Moo Moo', cursive !important;
    margin: 0 !important;
    color: #000 !important;
    text-align: center !important;
    font-size: 20px;
}


/* Remove all conflicting CSS rules - we'll handle this in JavaScript */
/* The display of menu items and navigation will be managed through JavaScript */