/* --- Base Styles --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    margin: 0;
    padding: 0;
    background-color: #fce4ec; /* Very light pink background */
    color: #4a4a4a; /* Dark grey for general text */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative; /* For background effects */
    overflow-x: hidden; /* Prevent horizontal scroll from background */
}

/* --- Background Animation (Subtle Grid/Network Effect) --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(to right, rgba(240, 98, 146, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(240, 98, 146, 0.1) 1px, transparent 1px);
    background-size: 20px 20px; /* Size of the grid cells */
    opacity: 0.3;
    z-index: -1; /* Behind content */
    animation: backgroundPulse 10s infinite alternate; /* Subtle pulsing */
}

@keyframes backgroundPulse {
    0% { opacity: 0.2; }
    50% { opacity: 0.4; } /* Adjusted for a more subtle pulse */
    100% { opacity: 0.2; }
}

/* --- Glowing Text Effect - Adapted for Light Theme --- */
.glowing-red {
    color: #e91e63; /* Deeper pink-red */
    text-shadow: 0 0 3px #e91e63, 0 0 8px #e91e63, 0 0 12px #e91e63;
    transition: text-shadow 0.3s ease-in-out;
}
.glowing-pink {
    color: #f06292; /* Brighter, softer pink */
    text-shadow: 0 0 3px #f06292, 0 0 8px #f06292, 0 0 12px #f06292;
    transition: text-shadow 0.3s ease-in-out;
}
/* Hover effect for glowing text */
.glowing-red:hover, .glowing-pink:hover {
    text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 20px currentColor;
}

/* --- Header Styling --- */
header {
    background-color: #f8bbd0; /* Medium pink for header */
    color: #fff;
    padding: 1.5rem 0;
    text-align: center;
    border-bottom: 5px solid #e91e63; /* Deeper pink line */
    position: relative; /* For header glow */
    box-shadow: 0 0 15px rgba(233, 30, 99, 0.3); /* Subtle glow */
    transition: box-shadow 0.3s ease-in-out; /* Smooth transition for scroll effect */
}
header.scrolled { /* Class added by JS on scroll */
    box-shadow: 0 0 25px rgba(233, 30, 99, 0.6);
}
header h1 {
    margin: 0;
    font-size: 3em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #e91e63; /* Deeper pink for title */
    text-shadow: 0 0 5px #e91e63, 0 0 10px #e91e63;
}
header p {
    font-size: 1.2em;
    margin-top: 0.5rem;
    font-style: italic;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
    color: #f06292; /* Softer pink for subtitle */
    text-shadow: 0 0 2px #f06292;
}

/* --- Container and Article Styling --- */
.container {
    width: 70%;
    max-width: 800px;
    margin: auto;
    overflow: hidden;
    padding: 2rem 0;
    flex-grow: 1;
}
article {
    background-color: #fff; /* White background for content */
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(233, 30, 99, 0.3); /* Enhanced glow around article */
    margin-bottom: 2rem;
    position: relative; /* For subtle hover effect */
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}
article:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 5px 25px rgba(233, 30, 99, 0.5); /* Stronger glow on hover */
}
/* Specific styling for the directory view article */
article.directory-view {
    font-family: 'monospace', 'Courier New', Courier, monospace; /* Hacker-style font for directory */
    background-color: #1a0a1a; /* Very dark, almost black, with a hint of purple/pink for cyberpunk bar */
    color: #e0e0e0; /* Light text for directory view */
    box-shadow: 0 0 35px rgba(233, 30, 99, 0.8); /* Intense glow for cyberpunk feel */
    padding: 2.5rem; /* Slightly more padding */
    border: 2px solid #e91e63; /* Stronger border */
    position: relative;
    overflow: hidden; /* For scanline effect */
}
/* Scanline effect for cyberpunk bar theme */
article.directory-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(0, 255, 0, 0.05) 1px, /* Subtle green scanline */
        rgba(0, 255, 0, 0.05) 2px
    );
    pointer-events: none;
    z-index: 0; /* Below text */
    opacity: 0.2;
    animation: scanlineFlicker 5s infinite linear;
}
@keyframes scanlineFlicker {
    0% { opacity: 0.15; }
    50% { opacity: 0.25; }
    100% { opacity: 0.15; }
}

article.directory-view .post-meta {
    color: #aaa;
    border-bottom-color: #e91e63;
    position: relative; /* Ensure it's above scanlines */
    z-index: 1;
}
article.directory-view h2 {
    color: #f06292;
    text-shadow: 0 0 5px #f06292;
    margin-bottom: 1.5rem;
    position: relative; /* Ensure it's above scanlines */
    z-index: 1;
}

/* --- NEW: Cyberpunk Path H2 Styling --- */
h2.cyberpunk-path {
    display: flex; /* Allow segments to sit side-by-side */
    justify-content: center; /* Center the path */
    align-items: baseline;
    font-size: 2.5em; /* Larger for impact */
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}
.cyberpunk-path .path-segment {
    padding: 0 0.2em;
    transition: text-shadow 0.3s ease-in-out;
}
.cyberpunk-path .path-segment:first-child,
.cyberpunk-path .path-segment:last-child {
    color: #e0e0e0; /* White for slashes */
    text-shadow: none;
}
.cyberpunk-path .underlined-red {
    color: #e91e63; /* Deeper pink-red */
    text-shadow: 0 0 8px #e91e63, 0 0 15px #e91e63;

    /* Fallback for text-decoration-thickness and text-underline-offset */
    /* These will be applied first by older browsers */
    text-decoration: none; /* Ensure no default underline */
    border-bottom: 2px solid #e91e63; /* Traditional underline */
    padding-bottom: 0.1em; /* Space between text and underline */

    /* Modern properties for better control, will override above in supporting browsers */
    /* These are the properties your IDE might be complaining about */
    text-decoration: underline; /* Re-enable text-decoration for modern browsers */
    text-decoration-color: #e91e63;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 2px;
}
.cyberpunk-path .blinking-green {
    color: #00ff00; /* Bright green for blinking effect */
    text-shadow: 0 0 8px #00ff00, 0 0 15px #00ff00, 0 0 25px #00ff00;
    animation: neonBlink 2s infinite alternate ease-in-out; /* Slow blink animation */
}

@keyframes neonBlink {
    0% {
        opacity: 1;
        text-shadow: 0 0 8px #00ff00, 0 0 15px #00ff00, 0 0 25px #00ff00;
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00;
    }
    100% {
        opacity: 1;
        text-shadow: 0 0 8px #00ff00, 0 0 15px #00ff00, 0 0 25px #00ff00;
    }
}


/* --- List Styling (Existing, but not used on directory page) --- */
ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
ul li {
    background-color: #fff;
    border: 1px solid #f8bbd0;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.1);
    transition: all 0.3s ease-in-out;
    position: relative;
    padding-left: 2.5rem;
}
ul li::before {
    content: '>';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #e91e63;
    font-weight: bold;
    font-size: 1.2em;
    text-shadow: 0 0 5px #e91e63;
}
ul li:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
    border-color: #e91e63;
}

/* --- Call to Action Styling --- */
.call-to-action {
    text-align: center;
    margin-top: 3rem;
    font-size: 1.2em;
    font-weight: bold;
    color: #e91e63;
    text-shadow: 0 0 3px #e91e63;
}
.call-to-action a {
    display: inline-block;
    background-color: #e91e63; /* Deeper pink button */
    color: #fff;
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1.5rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.4);
}
.call-to-action a:hover {
    background-color: #f06292; /* Softer pink on hover */
    box-shadow: 0 0 15px rgba(240, 98, 146, 0.6);
    transform: scale(1.05); /* Subtle grow effect on hover */
}

/* --- Footer Styling --- */
footer {
    background-color: #f8bbd0; /* Medium pink for footer */
    color: #e91e63; /* Deeper pink for footer text */
    padding: 1.5rem 0;
    margin-top: 2rem;
    border-top: 5px solid #e91e63;
    text-shadow: 0 0 2px #e91e63;
}
footer p {
    text-align: center;
    margin: 0;
}

/* --- Marquee Styling (JavaScript driven) --- */
.hacker-marquee {
    background-color: #e91e63; /* Deeper pink for marquee background */
    color: #fff;
    padding: 0.5rem 0;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(233, 30, 99, 0.6);
    font-family: 'monospace', 'Courier New', Courier, monospace; /* Hacker-style font */
    font-size: 1.1em;
    font-weight: bold;
    text-shadow: 0 0 5px #fff; /* White glow for marquee text */
    position: relative;
    height: 1.5em; /* Fixed height to prevent content jump */
    cursor: pointer;
}
.hacker-marquee-content {
    position: absolute; /* Positioned for JS to control 'left' */
    white-space: nowrap;
    left: 0; /* JS will manage this */
    top: 0;
    line-height: 1.5em; /* Match parent height */
    transition: text-shadow 0.1s ease-in-out; /* Smooth glow transition */
}
.hacker-marquee-content:hover {
    text-shadow: 0 0 8px #fff, 0 0 15px #fff; /* Stronger glow on hover */
}

/* --- Directory Tree Specific Styles (Desktop) --- */
.directory-tree.desktop-view {
    margin-top: 2rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(240, 98, 146, 0.5); /* Vertical line for the tree */
    position: relative;
    z-index: 1;
    overflow-x: auto; /* Allow horizontal scrolling if content overflows */
    padding-bottom: 10px; /* Space for scrollbar */
}

.dir-item, .file-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    cursor: pointer;
    padding: 0.3rem 0;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    z-index: 1;
    white-space: nowrap; /* Prevent text wrapping */
}

.dir-item:hover, .file-item:hover {
    background-color: rgba(240, 98, 146, 0.1); /* Light pink highlight on hover */
    color: #f06292; /* Pink text on hover */
}

.dir-toggle {
    font-size: 0.8em;
    margin-right: 0.5rem;
    width: 1em; /* Fixed width for alignment */
    text-align: center;
    color: #e91e63; /* Deeper pink for toggle */
    text-shadow: 0 0 5px #e91e63;
}

.dir-name { 
    font-weight: bold;
    color: #e0e0e0; /* Default color, overridden by glowing-pink in HTML */
    text-shadow: 0 0 3px #e0e0e0;
}
.file-name { 
    font-weight: bold;
    color: #e0e0e0; /* Default color, overridden by glowing-pink/red in HTML */
    text-shadow: 0 0 3px #e0e0e0;
}


.file-icon {
    margin-right: 0.5rem;
    color: #e91e63; /* Deeper pink for file icon */
    text-shadow: 0 0 3px #e91e63;
}

.dir-content {
    margin-left: 1.5rem; /* Indent for nested directories */
    border-left: 1px dashed rgba(240, 98, 146, 0.3); /* Dashed line for sub-directories */
    padding-left: 0.5rem;
    overflow: hidden; /* For collapse animation */
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    max-height: 1000px; /* Default max-height for open state, will be dynamically set by JS */
}

.dir-content.hidden {
    max-height: 0 !important; /* Use !important to ensure override */
    opacity: 0;
    pointer-events: none; /* Disable interaction when hidden */
}

.dir-item.open > .dir-toggle {
    transform: rotate(0deg); /* Reset rotation for open state */
}
.dir-item:not(.open) > .dir-toggle {
    transform: rotate(90deg); /* Rotate for closed state */
}

/* Selected file highlight */
.file-item.selected-file {
    background-color: rgba(0, 255, 0, 0.15); /* Subtle green highlight */
    border-left: 3px solid #00ff00;
    padding-left: 0.7rem; /* Adjust padding due to border */
}
.file-item.selected-file .file-name {
    text-shadow: 0 0 5px #00ff00, 0 0 10px #00ff00;
}


/* Group Details Panel */
.group-details {
    background-color: #0d0d0d; /* Even darker background for details */
    border: 1px solid #00ff00; /* Green border for contrast */
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 3rem;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6); /* Green glow */
    color: #e0e0e0;
    position: relative;
    z-index: 1;
}
.group-details h3 {
    color: #00ff00; /* Green for details heading */
    text-shadow: 0 0 5px #00ff00;
    border-bottom: 1px solid #00ff00;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.group-details p {
    color: #ccc;
    font-size: 0.95em;
}
.group-details .call-to-action {
    margin-top: 1.5rem;
}
.group-details .call-to-action a {
    padding: 0.8rem 1.5rem;
    font-size: 1em;
    background-color: #00ff00; /* Green button */
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
}
.group-details .call-to-action a:hover {
    background-color: #00cc00; /* Darker green on hover */
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
}

/* New Group Prompt */
.new-group-prompt {
    margin-top: 1.5rem;
    border-top: 1px dashed rgba(240, 98, 146, 0.3);
    padding-top: 1rem;
}
.new-group-prompt .file-icon {
    font-size: 1.5em;
    line-height: 1;
}

/* --- Mobile Directory Tree View (Hidden by default, shown on small screens) --- */
.directory-tree.mobile-view {
    display: none; /* Hidden by default */
    margin-top: 2rem;
    border: 1px solid #e91e63;
    border-radius: 8px;
    background-color: #0d0d0d;
    padding: 1rem;
    position: relative;
    z-index: 1;
    overflow: hidden; /* For slide animations */
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(233, 30, 99, 0.5);
}
.mobile-nav-header .back-button {
    background: none;
    border: none;
    color: #e91e63;
    font-family: 'monospace', 'Courier New', Courier, monospace;
    font-size: 1em;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    text-shadow: 0 0 5px #e91e63;
}
.mobile-nav-header .back-button:hover {
    background-color: rgba(233, 30, 99, 0.1);
}
.mobile-nav-header .current-path {
    flex-grow: 1;
    text-align: center;
    font-size: 1.1em;
    color: #f06292;
    text-shadow: 0 0 3px #f06292;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.5rem;
}

.mobile-dir-list {
    position: relative;
    overflow: hidden;
    min-height: 150px; /* Ensure some height even if empty */
}

.mobile-dir-level {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.3s ease-out;
    list-style: none;
    padding: 0;
    margin: 0;
}
.mobile-dir-level.entering-right {
    transform: translateX(100%);
}
.mobile-dir-level.current {
    transform: translateX(0);
}
.mobile-dir-level.exiting-left {
    transform: translateX(-100%);
}
.mobile-dir-level.entering-left {
    transform: translateX(-100%);
}
.mobile-dir-level.exiting-right {
    transform: translateX(100%);
}


.mobile-dir-level li {
    display: flex;
    align-items: center;
    padding: 0.8rem 0.5rem;
    border-bottom: 1px dashed rgba(240, 98, 146, 0.2);
    color: #e0e0e0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.mobile-dir-level li:last-child {
    border-bottom: none;
}
.mobile-dir-level li:hover {
    background-color: rgba(240, 98, 146, 0.1);
}
.mobile-dir-level li .item-icon {
    margin-right: 0.8rem;
    color: #e91e63;
    text-shadow: 0 0 3px #e91e63;
    font-size: 1.1em;
}
.mobile-dir-level li .item-name {
    flex-grow: 1;
    font-weight: bold;
}
.mobile-dir-level li .item-arrow {
    color: #f06292;
    font-weight: bold;
    margin-left: 0.5rem;
}
.mobile-dir-level li.file-item .item-arrow {
    display: none; /* No arrow for files */
}

/* --- Responsive Design (Mobile Support) --- */
@media (max-width: 768px) {
    /* Hide desktop view, show mobile view */
    .directory-tree.desktop-view {
        display: none;
    }
    .directory-tree.mobile-view {
        display: block;
    }

    /* Adjust container width for smaller screens */
    .container {
        width: 95%;
        padding: 1rem 0;
    }

    /* Header adjustments */
    header h1 {
        font-size: 2.2em;
    }
    header p {
        font-size: 1em;
    }

    /* Article padding and font size */
    article {
        padding: 1.5rem;
    }
    article.directory-view {
        padding: 1.5rem;
    }
    article h2 {
        font-size: 1.8em;
    }
    article h3 {
        font-size: 1.3em;
    }
    p {
        font-size: 1em;
    }

    /* Marquee adjustments */
    .hacker-marquee {
        font-size: 0.9em;
        height: 1.3em;
        padding: 0.3rem 0;
    }
    .hacker-marquee-content {
        line-height: 1.3em;
    }

    /* Group Details Panel adjustments */
    .group-details {
        padding: 1rem;
        margin-top: 2rem;
    }
    .group-details h3 {
        font-size: 1.4em;
    }
    .group-details p {
        font-size: 0.9em;
    }
    .group-details .call-to-action a {
        padding: 0.6rem 1.2rem;
        font-size: 0.9em;
    }

    /* Call to Action button adjustments */
    .call-to-action a {
        padding: 0.8rem 1.5rem;
        font-size: 1em;
    }

    /* Cyberpunk Path H2 adjustments */
    h2.cyberpunk-path {
        font-size: 1.8em;
        justify-content: flex-start; /* Align left on mobile if it wraps */
        padding-left: 0.5em; /* Add some padding */
    }
    .cyberpunk-path .underlined-red {
        /* Fallback for text-decoration-thickness and text-underline-offset */
        border-bottom: 1px solid #e91e63; /* Thinner traditional underline */
        padding-bottom: 0.05em; /* Smaller space */
        text-decoration: none; /* Remove default underline if border is used */

        /* Modern properties for better control, will override above in supporting browsers */
        text-decoration: underline;
        text-decoration-color: #e91e63;
        text-underline-offset: 0.15em;
        text-decoration-thickness: 1px;
    }
}

@media (max-width: 480px) {
    /* Further adjustments for very small screens */
    header h1 {
        font-size: 1.8em;
    }
    header p {
        font-size: 0.9em;
    }
    article h2 {
        font-size: 1.5em;
    }
    article h3 {
        font-size: 1.1em;
    }
    p {
        font-size: 0.9em;
    }
    .hacker-marquee {
        font-size: 0.8em;
        height: 1.2em;
    }
    .hacker-marquee-content {
        line-height: 1.2em;
    }
    .dir-name, .file-name {
        font-size: 0.9em;
    }
    .group-details h3 {
        font-size: 1.2em;
    }
    .group-details p {
        font-size: 0.85em;
    }
    h2.cyberpunk-path {
        font-size: 1.5em;
    }
}