@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    --bottom-border-position: 700px;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: black;
    color: #00ff00;
    position: relative;
    min-height: 300vh;
    overflow-x: hidden;
    margin: 0;
    padding-top: 20px;
    box-sizing: border-box;
}

.bg-blur {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/background-image.png') center/cover no-repeat;
    filter: blur(3px);
    z-index: -1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.main-content-container {
    z-index: 2;
    max-width: 700px;
    margin: 20px auto 30px auto;
    background: black;
    padding: 30px;
    border: 4px solid #ff00ff;
    border-radius: 10px;
    box-shadow: 0 0 20px #ff00ff;
    text-align: center;
    position: relative;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
}

.title {
    font-size: 24px;
    font-weight: bold;
    margin-top: 15px;
    text-shadow: 2px 2px #ff00ff;
}

.description {
    font-size: 14px;
    margin: 10px 0 20px;
    color: #ffcc00;
    text-shadow: 1px 1px #ff00ff;
}

.social-links {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.social-links a {
    position: absolute;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: black;
    border: 3px solid #ff00ff;
    border-radius: 10px;
    box-shadow: 0 0 10px #ff00ff;
    text-align: center;
    font-size: 10px;
    color: #00ff00;
    cursor: pointer;
    text-decoration: none;
    pointer-events: auto;
    z-index: 11;
    transition: transform 0.2s;
    box-sizing: border-box;
}

.social-links a img {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
}

.social-links a:hover {
    transform: scale(1.2);
    background: #ff00ff;
    box-shadow: 0 0 15px #ff00ff;
}

.social-links a::after {
    content: attr(data-text);
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffcc00;
    padding: 10px;
    border-radius: 5px;
    width: 250px;
    text-align: center;
    font-size: 12px;
    font-family: 'Press Start 2P', cursive;
    border: 2px solid #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.social-links a:hover::after {
    opacity: 1;
}

.static-button {
    background: black;
    color: #00ff00;
    font-size: 12px;
    font-family: 'Press Start 2P', cursive;
    padding: 10px 15px;
    border: 3px solid #ff00ff;
    border-radius: 5px;
    cursor: pointer;
    text-shadow: 1px 1px #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
    transition: all 0.3s ease;
}

.static-button:hover {
    background: #ff00ff;
    color: black;
    box-shadow: 0 0 15px #ff00ff;
    transform: scale(1.1);
}

/* Style for disabled buttons */
.static-button:disabled,
.static-button[disabled] {
    background: #333; /* Dark grey background */
    color: #888; /* Lighter grey text */
    border-color: #555; /* Darker border */
    text-shadow: none;
    box-shadow: none;
    transform: none;
    cursor: not-allowed; /* Show 'not-allowed' cursor */
}

.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.video-container {
    background: transparent;
    padding: 0;
    border-radius: 0;
    position: relative;
}

.video-frame {
    width: 100%;
    height: 100%;
    max-width: 800px;
    max-height: 450px;
    border: none;
}

.close-video {
    position: absolute;
    top: -10px;
    right: -10px;
    background: red;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 50%;
    z-index: 1001;
}

.age-check {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.age-check-content {
    background: rgba(25, 25, 25, 0.95);
    border: 2px solid #ffffff20;
    padding: 40px 50px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 0 25px #000000aa;
    z-index: 10000;
}

.age-check-content .title {
    font-size: 2rem;
    margin-bottom: 25px;
    color: white;
}

.age-check .button-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.age-check .static-button {
    background-color: #00aaff;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.age-check .static-button:hover {
    background-color: #007799;
}

/* Primary positioning for the main body sections */
#lower-sections {
    margin-top: 400px;
    width: 100%;
    box-sizing: border-box;
    z-index: 2;

    /* Use a fixed offset for the left margin, reduced for better balance */
    max-width: 700px;
    margin-left: 50px; 
    margin-right: auto;

    padding: 0 20px;
    margin-bottom: 50px;
    position: relative;
    overflow: visible;
}

.lower-sections-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

#lower-sections .main-content-container {
    margin: 0;
    text-align: left;
    width: 100%;
}

.section-header {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 40px;
    text-shadow: 2px 2px #ff00ff;
    color: #00ff00;
}

.section-image-placeholder {
    /* Desktop positioning */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 30px;
    width: 150px;
    height: 150px;
    background: transparent;
    border: 0px dashed #ff00ff;
    border-radius: 8px;
    overflow: hidden;
}

.section-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.section-content {
    font-size: 14px;
    color: #ffcc00;
    text-shadow: 1px 1px #ff00ff;
    margin-bottom: 20px;
    text-align: center;
}

.text-wrapper {
    /* Desktop spacing to make room for the absolute image */
    margin-right: 190px;
}

#lower-sections .section-content {
    text-align: left;
}

.full-width-showcase {
    width: 100%;
    padding: 30px 0;
    box-sizing: border-box;
    margin: 0 0 30px 0;
    background: black;
    border-top: 4px solid #ff00ff;
    border-bottom: 4px solid #ff00ff;
    box-shadow: none;
    text-align: center;
    z-index: 3;
    position: relative;
    overflow: visible;
}

.showcase-items-container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 40px;
    margin-top: 40px;

    width: 80vw;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding: 0;
}

.showcase-item {
    background: #1a1a1a;
    border: 3px solid #ff00ff;
    border-radius: 10px;
    box-shadow: none;
    padding: 20px;
    width: calc((100% - (2 * 40px)) / 3);
    min-width: 300px;
    height: 480px;
    text-align: center;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.showcase-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 25px #ff00ff;
}

.showcase-image-placeholder {
    width: 100%;
    height: 220px;
    position: relative;
    background: #0d0d0d;
    border: 2px solid #ff00ff;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
    cursor: pointer;
}

.showcase-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.showcase-title {
    font-size: 18px;
    color: #00ff00;
    margin-top: 15px;
    margin-bottom: 10px;
    text-shadow: 1px 1px #00ff00;
    flex-shrink: 0;
}

.showcase-description {
    font-size: 12px;
    color: #ffcc00;
    line-height: 1.2;
    text-shadow: 0.5px 0.5px #ff00ff;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

/* --- MOBILE RESPONSIVENESS (Start) --- */

/* Tablet/Small Desktop Optimization (Up to 900px) */
@media (max-width: 900px) {
    /* Main Content */
    .main-content-container {
        margin: 80px auto 30px auto;
        max-width: 90%; /* Use more width on tablet */
    }
    
    /* Lower Sections - Make them centered and full width on tablets */
    #lower-sections {
        margin-left: auto; /* Center the whole block */
        margin-right: auto;
        padding: 0 10px;
        max-width: 95%;
        gap: 20px;
    }

    /* Showcase Items - Stack into 2 columns */
    .full-width-showcase {
        padding: 30px 0;
        margin: 0 auto 30px auto;
    }

    .showcase-items-container {
        width: 90vw;
        padding: 0 10px;
        justify-content: space-around;
        gap: 20px;
    }
    .showcase-item {
        width: calc((100% - 20px) / 2);
        height: 400px;
        min-width: unset;
    }
    .showcase-image-placeholder {
        height: 180px;
    }
    .showcase-title {
        font-size: 18px;
    }
    .showcase-description {
        font-size: 13px;
        -webkit-line-clamp: 4;
    }
}

/* Mobile Phone Optimization (Up to 768px) */
@media (max-width: 768px) {
    /* Lower Sections (About Me, Streams, etc.) - Force Stacking */
    /* This overrides the desktop positioning for image/text */
    .text-wrapper {
        margin-right: 0; /* Remove space for image */
    }
    
    .section-image-placeholder {
        position: static; /* Remove absolute positioning */
        transform: none;
        margin: 20px auto 0 auto; /* Center the image and add margin above */
        width: 100%;
        max-width: 250px; /* Limit image size */
        height: 150px; 
    }
    
    #lower-sections .main-content-container {
        /* Ensure each section box flows vertically */
        display: flex;
        flex-direction: column-reverse; /* Put image before text in the DOM flow, but text appears first */
        text-align: center;
        padding-bottom: 10px; /* Add padding to the bottom of the section box */
    }
    
    .section-header {
        text-align: center;
        margin-bottom: 10px;
        margin-top: 20px;
    }

    .section-content {
        text-align: center;
    }

    /* Showcase Items - Stack into a single column */
    .showcase-items-container {
        width: 95vw;
        padding: 0 5px;
        gap: 20px;
        justify-content: center;
    }
    .showcase-item {
        width: 95%;
        max-width: 400px;
        height: auto;
        min-height: 400px;
        margin: 0 auto;
    }
}

/* Smallest Phone Optimization (Up to 500px) */
@media (max-width: 500px) {

    /* Main Section */
    .main-content-container {
        padding: 20px 10px; /* Less padding on small screen */
    }

    .button-container {
        gap: 10px;
    }

    .static-button {
        font-size: 10px;
        padding: 8px 12px;
    }

    /* Social Links (Moving Buttons) - Force them to stack vertically when toggled */
    /* We must disable the JS-driven absolute positioning */
    .social-links {
        /* This is a temporary fix, as the JS still moves them. 
           We use a large top margin to push them below the main box when toggled. */
        position: static;
        margin-top: 30px; 
        height: auto;
        /* Re-enable pointer events on the container */
        pointer-events: auto;
        
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 columns for better spacing */
        gap: 10px;
        padding: 0 10px;
    }
    
    .social-links a {
        position: static !important; /* CRITICAL: Override JS/Inline Styles for positioning */
        transform: none !important; /* CRITICAL: Override JS/Inline Styles for transform */
        width: 100%;
        height: 70px;
        /* Reset border/shadow for a flatter look on mobile */
        box-shadow: 0 0 5px #ff00ff;
        font-size: 8px;
    }

    .social-links a img {
        width: 30px;
        height: 30px;
    }
    
    .social-links a:hover {
        transform: none; /* Disable transform scale on hover */
    }

    .social-links a::after {
        display: none; /* Hide tooltips on small screens */
    }

    /* Lower Sections */
    #lower-sections {
        margin: 40px auto;
        padding: 0 5px;
    }
    
    .section-image-placeholder {
        /* Keep stacking logic */
        max-width: 120px; 
    }
    
    /* Modals - General cleanup */
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
}


/* --- MODAL STYLES (General & Image/Video) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: black;
    padding: 40px;
    border: 4px solid #ff00ff;
    border-radius: 10px;
    box-shadow: 0 0 25px #ff00ff;
    text-align: center;
    position: relative;
    max-width: 90%;
    width: 500px;
}

.modal-content .modal-title {
    font-size: 22px;
    text-shadow: 2px 2px #ff00ff;
    margin-bottom: 25px;
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: red;
    color: white;
    border: 2px solid white;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 1001;
}

/* Styles for the standard image modal */
.image-modal-content {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    text-align: center;
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: block; /* Ensure it behaves like a container */
}

/* New specific styles for the Resourcepack Modal (85% screen width) */
.resourcepack-modal-content {
    max-width: 85vw;
    width: 1200px; /* Max width for large screens */
    height: 85vh; 
    min-height: 450px; 
    background: black;
    border: 4px solid #ff00ff;
    border-radius: 10px;
    box-shadow: 0 0 25px #ff00ff;
    padding: 15px; 
    overflow: hidden; 
    display: block; 
    box-sizing: border-box;
}

/* Target the text container *inside* the custom modal and make IT the flex parent */
.resourcepack-modal-content #modal-text-container {
    display: flex;
    gap: 20px;
    width: 100%;
    height: 100%; /* Fill the parent modal content box */
}

.resourcepack-modal-content .modal-left-panel {
    width: 55%; /* Media panel width (55%) */
    flex-grow: 0; 
    display: flex;
    flex-direction: column; /* Stack images vertically */
    gap: 15px;
    align-items: center; 
    justify-content: flex-start; 
    overflow-y: hidden; 
}

.resourcepack-modal-content .modal-right-panel {
    width: 45%; /* Text box ratio increased to 45% */
    min-width: 300px;
    padding: 10px;
    /* This is the VERTICAL line separating the media and text panels. */
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
    overflow-y: auto; /* Allow scrolling for text content */
}

/* Style for images *only* inside the resourcepack modal */
.resourcepack-modal-content img {
    /* CRITICAL CHANGE: Force 512x300 dimensions for cramming */
    width: 512px; 
    height: 300px; 
    object-fit: cover; 
    
    max-width: 100%; 
    
    border: 4px solid #00ff00; 
    border-radius: 8px; 
    box-shadow: 0 0 15px #00ff00;
    flex-shrink: 0; 
}

/* Reset for the single image element (ID selector for specificity) */
#image-modal-overlay #modal-image {
    max-width: 80vw;
    max-height: 80vh;
    display: block;
    margin: 0;
    border: 4px solid #ff00ff;
    border-radius: 10px;
    box-shadow: 0 0 25px #ff00ff;
}

.image-modal-content .close-modal-btn {
    position: absolute;
    top: -20px;
    right: -20px;
}

/* Corrected positioning for the close button in the custom modal */
.resourcepack-modal-content .close-modal-btn {
    top: 10px; 
    right: 10px;
    z-index: 1002;
}

.resourcepack-info {
    font-size: 14px;
    color: #ffcc00;
    line-height: 1.5;
    text-shadow: 1px 1px #ff00ff;
}

.resourcepack-info .status-label {
    color: #00ff00;
    font-weight: bold;
}

/* Rule for custom tooltips on download buttons */
.resourcepack-modal-content .button-container a {
    position: relative; /* This is the container for the tooltip */
    display: block; /* Ensures the <a> tag is a block */
}

.resourcepack-modal-content .button-container a::after {
    content: attr(data-text); /* Pulls text from the data-text attribute */
    position: absolute;
    bottom: 110%; /* Position the tooltip above the button */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffcc00;
    padding: 10px;
    border-radius: 5px;
    width: 250px; /* Same width as your other tooltips */
    text-align: center;
    font-size: 12px;
    font-family: 'Press Start 2P', cursive;
    border: 2px solid #ff00ff;
    box-shadow: 0 0 10px #ff00ff;
    opacity: 0; /* Hide by default */
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10; /* Make sure it's on top */
}

.resourcepack-modal-content .button-container a:hover::after {
    opacity: 1; /* Show on hover */
}


.hidden-links {
    /* If the moving buttons are toggled off, they are hidden */
    display: none;
}

/* Media query for smaller screens on the custom modal */
@media (max-width: 1200px) {
    .resourcepack-modal-content {
        max-width: 90vw;
        width: 90vw;
        height: auto;
        min-height: unset;
    }
    
    /* On smaller screens, stack the panels */
    .resourcepack-modal-content #modal-text-container {
        flex-direction: column;
    }
    
    .resourcepack-modal-content .modal-right-panel {
        width: 100%;
        border-left: none;
        border-top: 2px solid #00ff00;
        padding-top: 20px;
        overflow-y: auto; /* Allow scrolling on smaller screens if content is long */
    }

    .resourcepack-modal-content .modal-left-panel {
        height: auto;
        width: 100%;
        overflow-y: auto; /* Allow scrolling on smaller screens if content is long */
    }
    /* When stacking vertically, images should fit max width */
    .resourcepack-modal-content img {
        width: 100%;
        height: auto;
        max-width: 512px; /* Set max-width to the desired size */
    }
}