/* ==========================================================================
   1. CSS Reset & Basic Setup
   ========================================================================== */

/* Hide scrollbar and prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

html::-webkit-scrollbar, 
body::-webkit-scrollbar {
    display: none;
}

#__next {
    overflow-x: hidden;
    max-width: 100vw;
}

#splash {
    transition: opacity 0.3s ease;
}

#splash:hover {
    content: url('../assets/img/title2.png');
}

/* ==========================================================================
   2. Typography & Font Faces
   ========================================================================== */

   @font-face {
    font-family: 'modified-dot-matrix';
    src: url('../fonts/LowerResolution.ttf') format('truetype');
   }
   
   @font-face {
    font-family: 'CloisterBlack';
    src: url('../fonts/CloisterBlack.ttf') format('truetype');
 }
 
   @font-face {
    font-family: 'Ticker';
    src: url('../fonts/SubwayTickerGrid.ttf') format('truetype');
 }
 
/* ==========================================================================
   3. Base Styles & Layout
   ========================================================================== */

body {
    font-family: 'modified-dot-matrix', sans-serif;
    line-height: 1.6;
    color: #ffffff;
    margin: 0 auto;
    padding-top: 50px;
    padding-bottom: 15px;
    background-color: #000000;
    background-image: url('../assets/laser2.gif');
    background-repeat: repeat;
    background-attachment: fixed;
    font-size: clamp(18px, 4vw, 23px);
    flex-direction: column;
    align-items: center;
}

#__next {
    max-width: 700px;
    margin: 0 auto;
    padding: clamp(10px, 3vw, 20px);
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    background-color: rgba(0, 0, 0, 0);
    background-repeat: repeat;
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ticker-wrapper {
    width: 100%;
    height: 26px;
    background-color: #000000;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
}

.ticker {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
}

.ticker-content {
    display: inline-block;
    padding-left: 100%;
    animation: 
        ticker 20s linear infinite,
        rgb-gradient 10s linear infinite;
    font-family: 'Ticker', sans-serif;
    font-size: 12px;
    transform: translateY(-1px);
    margin-top: -100px;
    background: linear-gradient(
        to right, 
        #ff0000,
        #ff00ff,
        #00ff00,
        #00ffff,
        #fff700,
        #ff6f00
    );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

@keyframes rgb-gradient {
    0% {
        background-position: 0% center;
    }
    100% {
        background-position: -200% center;
    }
}

@keyframes ticker {
    0% {
        transform: translate3d(0, -1px, 0);  /* Combined with Y translation */
    }
    100% {
        transform: translate3d(-100%, -1px, 0);  /* Combined with Y translation */
    }
}

/* ==========================================================================
   4. Header & Navigation
   ========================================================================== */

   .back-button {
    position: fixed;
    top: 0;
    left: 10px;
    height: 20px; /* Match height of nav bar */
    display: flex;
    align-items: center;
    background-color: transparent; /* Make button background transparent */
    z-index: 1001; /* Ensure button is above the bar */
}

/* Create the black bar */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background-color: #000000;
    z-index: 1000;
}

h1 {
    color: #000000;
    text-align: center;
    margin-bottom: 0px;
}

/* ==========================================================================
   4.5. Rotating Banner Styles
   ========================================================================== */

   #rotating-banner {
    width: 100%;
    max-width: 700px;
    margin-top: 10px;
    text-align: center;
}

/* ==========================================================================
   5. Content Area Styles
   ========================================================================== */

#content-area {
    background-color: #000000;
    background-image: url('../assets/eoeo.gif');
    background-repeat: repeat;
    background-attachment: fixed;
    padding: clamp(5px, 2vw, 10px);
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    margin-top: 10px;
    transition: transform 0.5s ease;
    border: 0px solid #ffffff; 
}

/* ==========================================================================
   6. Form Elements & Controls
   ========================================================================== */

.form-elements-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-element {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.text-input {
    width: 80%;
    padding: 10px;
    font-size: 18px;
    border: 1px solid #ff0000;
    background-color: #ffffff00;
    color: #00ff26;
    font-family: 'modified-dot-matrix', sans-serif;
}

/* Input Range Slider Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 60%;
    height: 25px;
    margin: 0 auto;
    display: block;
    background: none;
    border: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    background: #000000;
    border: 1px solid #00ff26;
    border-radius: 0px;
    cursor: pointer;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 10px;
    background: #af5a5a;
    border: 1px solid #00ff26;
    border-radius: 0px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 25px;
    width: 4px;
    background: #ff0000;
    cursor: pointer;
    margin-top: -8px;
    border: none;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

input[type="range"]::-moz-range-thumb {
    height: 25px;
    width: 4px;
    background: #ff0000;
    cursor: pointer;
    border: none;
    border-radius: 0;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* ==========================================================================
   7. Button Styles
   ========================================================================== */

.action-button {
    background-color: #000000;
    color: #ff0000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    font-size: 20px;
    margin: 0;
    transition: background-color 0.3s ease;
    min-width: fit-content;
}

.action-button:hover {
    background-color: #431a58;
}

.upload-button {
    display: inline-block;
    background-color: #000000;
    color: #ff0000;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    transition: background-color 0.3s ease;
    width: auto;
    text-align: center;
    margin: 0 auto;
}

.upload-button:hover {
    background-color: #431a58;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    width: 100%;
    height: 33px;
}

.social-button {
    background-color: #00000000;
    color: #ff000000;
    border: 2px solid #ff000000;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    font-size: 2px;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 30px;
    height: 5px;
    /* Base background properties */
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Unique background for each button */
.social-button:nth-child(1) {
    background-image: url('../assets/butt1.png');
}

.social-button:nth-child(2) {
    background-image: url('../assets/butt2.png');
}

.social-button:nth-child(3) {
    background-image: url('../assets/butt4.png');
}

.social-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0);
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
}

#deepfryBtn, #downloadBtn {
    background-color: #00000000;
    color: #ff000000;
    border: 2px solid #ff000000;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    font-size: 16px;
    margin: 10px 5px;
    transition: all 0.3s ease;
    width: 80px;
    height: 5px;
    margin-top: -30px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* Apply Filter Button */
#deepfryBtn {
    background-image: url('../assets/DEEP.png');
}

/* Save Meme Button */
#downloadBtn {
    background-image: url('../assets/IMG.png');
}

#deepfryBtn:hover, #downloadBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0);
}

/* ==========================================================================
   8. Image & Canvas Styles
   ========================================================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

#uploadedImage {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 10px auto;
    max-height: 70vh;
}

#canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    margin-top: -20px;
}

#imageContainer {
    max-width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Special styling for AIDS.png and AIDSMONSTER.png */
[src*="AIDSMONSTER"] {
    transition: transform 2s ease;
    width: 700px;
    height: auto;
    display: block;
    margin: 0 auto;
}

#aidsmonster-image {
    border: 2px solid #000000;
    transition: 0.3s ease;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
    cursor: pointer;
}

#aidsmonster-video {
    border: 2px solid #ff0000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
    cursor: pointer;
}

#aidsmonster-image:hover {
    border: 2px solid #ff0000;
}

#aidsmonster-video {
    display: none; /* Initially hidden */
}

/* ==========================================================================
   9. Color Selector Styles
   ========================================================================== */

.color-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.color-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #000000;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    border-color: #00e5ff;
    transform: scale(1.1);
}

.color-btn:hover {
    transform: scale(1.1);
}

.color-btn.active {
    transform: scale(1.1);
}

/* ==========================================================================
   10. Overlay Selector Styles
   ========================================================================== */

#overlay-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px auto;
    padding: 10px;
    background-color: transparent;
    width: fit-content;
}

.prev-overlay,
.next-overlay {
    background-color: #000000;
    color: #ff0000;
    border: none;
    padding: 5px 15px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    font-size: 20px;
    transition: background-color 0.3s ease;
    border-radius: 5px;
}

.prev-overlay:hover,
.next-overlay:hover {
    background-color: #431a58;
}

#overlay-selector .overlay-name {
    color: #ff0000;
    font-family: 'modified-dot-matrix', sans-serif;
    font-size: 18px;
    min-width: 150px;
    text-align: center;
    background: none;
}

.font-settings {
    width: 80%;
}

details {
    border: 1px solid #000000;
    background: #000000;
    font-size: 18px;
    margin-bottom: 0px;
}

summary {
    background-color: #000000;
    color: #747474;
    padding: 0px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    transition: all 0.3s ease;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary:hover {
    color: #ff0000;
}

summary::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

details[open] summary::after {
    transform: rotate(180deg);
}

.settings-content {
    padding: 20px;
    border-top: 1px solid #000000;
    border: 1px solid #000000;
}

.font-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: -40px;
}

.text-center {
    text-align: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.filter-settings {
    width: 80%;
}

.filter-settings details {
    border: 1px solid #000000;
    background: #000000;
    font-size: 18px;
    margin-bottom: 0px;
}

.filter-settings summary {
    background-color: #000000;
    color: #747474;
    padding: 0px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    transition: all 0.3s ease;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-settings summary:hover {
    color: #ff0000;
}

.filter-settings summary::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.filter-settings details[open] summary::after {
    transform: rotate(180deg);
}

.filter-settings .settings-content {
    padding: 20px;
    border-top: 1px solid #000000;
    border: 1px solid #000000;
}

.filter-settings .text-center {
    text-align: center;
}

.filter-settings label {
    color: #ffffff;
    font-family: 'modified-dot-matrix', sans-serif;
}

.filter-settings #filterPresetName {
    color: #ffffff;
    font-family: 'modified-dot-matrix', sans-serif;
    font-size: 16px;
    margin: 10px 0;
}

.filter-settings #filterIntensity {
    -webkit-appearance: none;
    appearance: none;
    width: 60%;
    height: 25px;
    margin: 0 auto;
    display: block;
    background: none;
    border: none;
}

.filter-settings #filterIntensity::-webkit-slider-runnable-track {
    width: 100%;
    height: 10px;
    background: #000000;
    border: 1px solid #00ff26;
    border-radius: 0px;
    cursor: pointer;
}

.filter-settings #filterIntensity::-moz-range-track {
    width: 100%;
    height: 10px;
    background: #af5a5a;
    border: 1px solid #00ff26;
    border-radius: 0px;
    cursor: pointer;
}

.filter-settings #filterIntensity::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 25px;
    width: 4px;
    background: #ff0000;
    cursor: pointer;
    margin-top: -8px;
    border: none;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.filter-settings #filterIntensity::-moz-range-thumb {
    height: 25px;
    width: 4px;
    background: #ff0000;
    cursor: pointer;
    border: none;
    border-radius: 0;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

.watermark-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.watermark-btn {
    width: 20px;
    height: 20px;
    border: 1px solid #000000;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease;
    background-size: cover;
    background-color: #ff0000; /* Solid red background */
    background-image: none;
}
.watermark-btn:hover {
    transform: scale(1.1);
}

.watermark-btn.active {
    border-color: #00e5ff;
    transform: scale(1.1);
}

.sticker-settings {
    width: 80%;
}

.sticker-settings details {
    border: 1px solid #000000;
    background: #000000;
    font-size: 18px;
    margin-bottom: 0px;
}

.sticker-settings summary {
    background-color: #000000;
    color: #747474;
    padding: 0px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    transition: all 0.3s ease;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sticker-settings summary:hover {
    color: #ff0000;
}

.sticker-settings summary::after {
    content: '▼';
    font-size: 12px;
    transition: transform 0.3s ease;
}

.sticker-settings details[open] summary::after {
    transform: rotate(180deg);
}

.sticker-settings .settings-content {
    padding: 20px;
    border-top: 1px solid #000000;
    border: 1px solid #000000;
}

.sticker-settings .action-button {
    background-color: #000000;
    color: #ffffff;
    padding: 8px 16px;
    cursor: pointer;
    font-family: 'modified-dot-matrix', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
    margin: 5px;
}

.sticker-settings .action-button:hover {
    background-color: #000000;
    color: #ff0000;
}

#deleteStickerBtn {
    border-color: #ff0000;
    color: #ff0000;
}

#deleteStickerBtn:hover {
    background-color: #ff0000;
    color: #000000;
}

.sticker {
    position: absolute;
    cursor: move;
    border: 2px solid transparent;
}

.sticker.selected {
    border: 2px solid #00ff26;
}

.sticker-resize-handle {
    width: 10px;
    height: 10px;
    background-color: #00ff26;
    position: absolute;
    right: -5px;
    bottom: -5px;
    cursor: se-resize;
    display: none;
}

.sticker.selected .sticker-resize-handle {
    display: block;
}

.sticker-box {
    position: absolute;
    border: 2px solid #00ff26;
    cursor: move;
    pointer-events: all;
}

.sticker-box .delete-btn {
    position: absolute;
    right: -10px;
    top: -10px;
    width: 20px;
    height: 20px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1;
    user-select: none;
}

.sticker-box .resize-handle {
    width: 10px;
    height: 10px;
    background: #00ff26;
    position: absolute;
    right: -5px;
    bottom: -5px;
    cursor: se-resize;
}

.sticker-box img {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#canvas-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

/* ==========================================================================
   11. Layout Containers
   ========================================================================== */

.horizontal-element-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 80%;
    margin: 0 auto;
}

.combinedScaleContainer {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 300px;
    margin: 0 auto;
}

/* ==========================================================================
   12. Word Area
   ========================================================================== */

.box {
    background-color: #000000;
    background-repeat: repeat;
    background-attachment: fixed;
    padding: 10px;
    margin-top: 10px;
    border-radius: 0px;
    transition: transform 0.3s ease;
    border: 0px solid #ffffff; 
}

#cheese-explanation {
    background-color: #000000;
    background-repeat: repeat;
    background-attachment: fixed;
    padding: 10px;
    margin-top: 20px;
    border-radius: 0px;
    transition: transform 0.3s ease;
    border: 0px solid #ffffff;
}

/* ==========================================================================
   13. Footer Styles
   ========================================================================== */

#footer {
    text-align: center;
    padding-top: 0;
    background-color: rgb(0, 0, 0);
    width: 100%;
}

/* ==========================================================================
   14. Media Queries
   ========================================================================== */

@media screen and (max-width: 600px) {
    #splash-container {
        text-align: center;
        padding-top: 2px;
        margin-bottom: 0;
        position: relative;
        width: 100%;
    }

    .mobile {
        background-color: #000000;
        background-repeat: repeat;
        background-attachment: fixed;
        padding: 10px;
        border-radius: 0px;
        transition: transform 0.3s ease;
        border: 0px solid #ffffff; 
    }

    body {
        padding-top: 35px;
    }

    #__next {
        background-image: url('../assets/laser2.gif');
        background-repeat: repeat;
        background-attachment: fixed;
    }

}

@media screen and (max-width: 450px) {
    #footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 0;
        height: 20px;
        line-height: 0;
    }

    #footer p {
        margin-top: 0; /* Remove default paragraph margin */
        margin-bottom: 0; /* Remove bottom margin */
        line-height: 1; /* Reduce line height to compress text */
    }

    .back-button {
        position: fixed;
        top: 0;
        left: 10px;
        height: 20px; /* Match height of nav bar */
        display: flex;
        align-items: center;
        background-color: transparent; /* Make button background transparent */
        z-index: 1001; /* Ensure button is above the bar */
    }

    /* Create the black bar */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 20px;
        background-color: #000000;
        z-index: 1000;
    }

    #__next {
        padding-bottom: 30px;
    }

    #splash-container {
        text-align: center;
        padding-top: 2px;
        margin-bottom: 0;
        position: relative;
        width: 100%;
    }
}
