/* Define CSS variables for retro Mac colors and styles */
:root {
    --card-background: white; /* White card background */
    --nav-background: #2a2a2a00; /* Transparent for capsule navbar */
    --nav-capsule: #3c3c3c8b; /* Slightly lighter for capsule effect */
    --text: #ffffff; /* White text for readability */
    --text-secondary: #b3b3b3; /* Lighter gray for secondary text */
    --accent: rgb(29, 29, 29); /* Modernized blue for buttons and links */
    --accent-hover: rgb(18, 18, 18); /* Darker blue for hover */
    --border: #cccccc; /* Lighter gray border for modern look */
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3); /* Slightly darker shadow */
    --shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.4); /* Enhanced hover shadow */
    --font-family: 'Chicago', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; /* Modern font stack */
}

/* Base styles for the page */
body {
    background: transparent; /* Transparent body background */
    color: var(--text);
    font-family: var(--font-family);
    margin: 0;
    font-size: 18px; /* Slightly smaller base font for modern look */
    line-height: 1.6; /* Improved line height for readability */
    min-height: 100vh; /* Ensure full viewport height */
    padding-right: 80px; /* Space for fixed right sidebar on desktop */
    width: 100vw; /* Ensure body matches viewport width */
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Navigation for desktop */
.retro-nav {
    width: 60px; /* Narrow width for vertical navbar */
    height: 100vh; /* Full viewport height */
    position: fixed;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center vertically */
    align-items: center;
    padding: 20px 0;
    border-radius: 20px 0 0 20px; /* Capsule-like left edges */
    background: var(--nav-background); /* Ensure background matches theme */
    z-index: 1000; /* Ensure navbar stays above other content */
}

.nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: var(--nav-capsule);
    padding: 20px 10px;
    border-radius: 20px; /* Capsule shape */
    height: fit-content;
}

.retro-title {
    display: none; /* Hide title for icon-only design */
}

.burger-menu {
    display: none; /* Hidden by default, shown on mobile */
    color: var(--card-background);
    font-size: 24px;
    cursor: pointer;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.nav-links a {
    color: var(--card-background);
    text-decoration: none;
    font-size: 24px; /* Larger for icons */
    transition: transform 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
    color: var(--accent-hover);
    transform: scale(1.2); /* Slight scale effect on hover */
}

/* Tooltip for icon labels */
.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: attr(data-tooltip); /* Use data-tooltip for text */
    position: absolute;
    right: 100%; /* Position tooltip to the left (right of navbar) */
    top: 50%;
    transform: translateY(-50%);
    background: var(--nav-background);
    color: var(--card-background); /* Default white text for contrast */
    padding: 6px 12px; /* Slightly larger padding */
    border-radius: 6px; /* Smoother border-radius */
    font-size: 16px; /* Smaller for readability */
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    margin-right: 10px;
    border: 1px solid var(--border);
}

.nav-links a:hover::after {
    opacity: 1;
    visibility: visible;
    color: var(--text); /* White text on hover */
}

/* Mobile menu styles */
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0; /* Changed from right: 0 to left: 0 */
    height: 100vh;
    width: 100vw; /* Full viewport width */
    background: var(--nav-capsule);
    padding: 40px 20px;
    transform: translateX(-100%); /* Slide in from left */
    transition: transform 0.3s ease-in-out;
    z-index: 1001;
    justify-content: flex-start;
    align-items: flex-start;
    box-sizing: border-box; /* Ensure padding is included in width */
}

.nav-links.active.show {
    transform: translateX(0);
}

.nav-links .nav-text {
    display: none; /* Hidden on desktop */
}

.nav-links.active .nav-text {
    display: inline; /* Show text in mobile menu */
    margin-left: 10px;
    font-size: 18px;
}

.nav-links.active a {
    font-size: 18px;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px;
}

.nav-links.active a::after {
    display: none; /* Hide tooltips in mobile menu */
}

.nav-close {
    display: none;
    color: var(--card-background);
    font-size: 24px;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
}

.nav-links.active .nav-close {
    display: block;
}

/* Full-screen sections with black background */
.retro-section {
    width: 100vw; /* Full viewport width */
    min-height: 100vh; /* Full viewport height */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Center content vertically */
    align-items: center; /* Center content horizontally */
    padding: 32px 16px; /* Increased padding for better spacing */
    background: #000000; /* Solid black background */
    box-sizing: border-box; /* Ensure padding doesn't affect width */
    position: relative; /* For positioning pseudo-elements */
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Home section with centered PNG background */
#home {
    position: relative; /* For positioning the video and content */
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    background: #000000; /* Solid black background */
    box-sizing: border-box;
    overflow-x: hidden;
}

#home .background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    height: 80%;
    max-height: 600px;
    object-fit: contain; 
    opacity: 0.5;
    z-index: 1; 
}

#about {
    position: relative; /* For positioning the video and content */
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    background: #000000; /* Solid black background as fallback */
    box-sizing: border-box;
    overflow-x: hidden;
}

#about .background-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Full width of the section */
    height: 100%; /* Full height of the section */
    object-fit: cover; /* Fill the section, cropping if necessary */
    opacity: 0.5; /* Subtle opacity to avoid overpowering text */
    z-index: 1; /* Behind content but above section background */
}


.retro-card {
    border-radius: 16px; /* Larger border-radius for modern look */
    padding: 24px; /* Increased padding for better spacing */
    margin: 16px 0; /* More margin for visual separation */
    max-width: 900px; /* Constrain content width for readability */
    width: 100%; /* Ensure card spans container */
    box-sizing: border-box; /* Include padding in width */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center; /* Center all text within card */
    position: relative; /* Ensure card is above pseudo-element */
    z-index: 2; /* Above background image */
}

.retro-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px); /* Subtle lift effect */
}

/* Grid for releases and beta versions */
.retro-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 16px; /* Consistent spacing */
    margin-top: 16px;
    max-width: 900px; /* Match card max-width */
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
}

/* Grid cards */
.retro-grid .retro-card {
    min-height: 300px; /* Fixed height for uniformity */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute content evenly */
    padding: 16px;
    box-sizing: border-box;
}

.retro-grid .retro-card .content-container {
    flex-grow: 1; /* Allow content to fill space */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.retro-grid .retro-card .retro-subheading {
    margin-bottom: 8px;
    font-size: 24px; /* Slightly smaller for grid */
}

.retro-grid .retro-card .retro-text {
    flex-grow: 1; /* Ensure text takes available space */
    margin-bottom: 12px;
    font-size: 16px; /* Slightly smaller for grid */
    overflow: hidden; /* Prevent overflow */
    text-overflow: ellipsis; /* Truncate long text */
}

.retro-grid .retro-card .retro-image {
    max-width: 100%;
    height: auto;
    max-height: 100px; /* Constrain image height */
    margin: 8px auto; /* Center image */
    display: block;
}

.retro-grid .retro-card .retro-button-group {
    margin-top: auto; /* Push buttons to bottom */
}

/* Release Notes vertical grid */
.release-notes-grid {
    display: flex;
    flex-direction: column; /* Vertical stacking */
    gap: 16px; /* Consistent spacing */
    margin-top: 16px;
    max-width: 900px; /* Match card max-width */
    width: 100%;
    box-sizing: border-box; /* Include padding in width */
}

.release-note-card {
    background: var(--card-background); /* White background */
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 16px;
    min-height: 300px; /* Match retro-grid cards */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box; /* Include padding in width */
}

.release-note-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px); /* Subtle lift effect */
}

.release-note-editor {
    min-height: 200px; /* Fixed height for editing */
    max-height: 250px; /* Limit height */
    overflow-y: auto; /* Scroll if needed */
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f9f9f9; /* Slightly off-white for contrast */
    color: #333; /* Dark text for readability */
    font-size: 16px;
    line-height: 1.8;
    flex-grow: 1; /* Fill available space */
    box-sizing: border-box;
}

.release-note-editor:empty:before {
    content: attr(placeholder);
    color: #666; /* Placeholder color */
    font-style: italic;
}

/* Responsive grid */
@media (min-width: 640px) {
    .retro-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns */
    }
}

@media (min-width: 1024px) {
    .retro-grid {
        grid-template-columns: repeat(3, 1fr); /* Three columns */
    }
}

/* Headings */
.retro-heading {
    font-size: 48px; /* Larger for modern hierarchy */
    text-transform: uppercase;
    font-weight: 900; /* Bolder for emphasis */
    margin-bottom: 16px; /* More spacing */
    color: var(--text); /* White text */
}

.retro-subheading {
    font-size: 32px; /* Larger for hierarchy */
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text); /* White text */
}

.retro-h3 {
    font-size: 28px; /* Adjusted for hierarchy */
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text); /* White text */
}

/* Text */
.retro-text {
    font-size: 18px; /* Larger for readability */
    line-height: 1.8; /* Improved line height */
    color: var(--text-secondary); /* Light gray for contrast */
    margin-bottom: 16px;
}

/* Lists */
.retro-list {
    margin: 0 auto 16px; /* Center list and add bottom margin */
    padding-left: 24px; /* Slightly larger indent */
    max-width: 600px; /* Constrain list width for readability */
    box-sizing: border-box; /* Include padding in width */
}

.retro-list li {
    font-size: 16px; /* Larger for readability */
    color: var(--text-secondary); /* Light gray for contrast */
    margin-bottom: 8px;
    text-align: left; /* Left-align list items for readability */
}

/* Buttons */
.retro-button {
    background: var(--accent); /* Solid blue background */
    color: var(--card-background); /* White text for contrast */
    padding: 12px 24px; /* Larger padding for modern look */
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 16px; /* Larger for readability */
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden; /* For gradient and glow effects */
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.4s ease;
}

.retro-button:hover {
    background: linear-gradient(45deg, var(--accent), var(--accent-hover)); /* Gradient on hover */
    box-shadow: 0 0 15px var(--accent-hover), 0 0 25px var(--accent); /* Glowing effect */
    transform: scale(1.05) translateY(-2px); /* Slight bounce */
    animation: pulseGlow 1.5s ease-in-out infinite; /* Pulsing glow animation */
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(29, 29, 29, 0.5);
    }
    50% {
        box-shadow: 0 0 15px var(--accent-hover), 0 0 30px rgba(18, 18, 18, 0.7);
    }
    100% {
        box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(29, 29, 29, 0.5);
    }
}

@keyframes bounce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1.05);
    }
}

.retro-button:active {
    transform: scale(0.95); /* Slight press effect */
}

/* Button group */
.retro-button-group {
    margin-top: 16px;
    display: flex;
    gap: 12px; /* Modern flex gap */
    justify-content: center; /* Center buttons */
}

/* Footer */
.retro-footer {
    background: var(--nav-background);
    border-top: 2px solid var(--border);
    padding: 16px; /* Increased padding */
    text-align: center;
    width: 100vw; /* Full width */
    box-sizing: border-box; /* Include padding in width */
    color: var(--text); /* White text */
}

/* White class for footer links */
.white img {
    filter: invert(1);
}

.white a {
    color: var(--card-background); /* White for contrast */
    text-decoration: none;
    font-size: 24px; /* Larger for icons */
    transition: transform 0.2s ease, color 0.2s ease;
}

.white a:hover {
    color: var(--accent-hover);
    transform: scale(1.2); /* Slight scale effect on hover */
}

.white a::after {
    content: attr(data-tooltip); /* Use data-tooltip for text */
    position: absolute;
    right: 100%; /* Position tooltip to the left */
    top: 50%;
    transform: translateY(-50%);
    background: var(--nav-background);
    color: var(--card-background); /* White text */
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    margin-right: 10px;
    border: 1px solid var(--border);
}

.white a:hover::after {
    opacity: 1;
    visibility: visible;
    color: var(--text); /* White text on hover */
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.retro-section, .retro-footer {
    animation: fadeIn 0.8s ease-in-out; /* Slightly longer for smoother effect */
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(16px); /* Larger initial offset */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.retro-heading, .retro-subheading, .retro-text, .retro-list {
    animation: slideIn 0.6s ease-in-out;
}

/* 404 Page Styles */
.retro-404 {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Full height */
    padding: 32px;
    text-align: center;
    background: #000000; /* Solid black background */
    width: 100vw;
    box-sizing: border-box; /* Include padding in width */
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.retro-404-image {
    width: 400px; /* Slightly smaller for balance */
    height: 400px;
    border: 2px solid var(--border);
    margin: 0 auto 16px; /* Center image */
}

.retro-404-text {
    font-size: 64px; /* Larger for emphasis */
    font-weight: 900;
    color: var(--text); /* White text */
}

/* Responsive styles for mobile */
@media (max-width: 640px) {
    body {
        padding-right: 0; /* Remove padding for mobile */
        padding-bottom: 60px; /* Space for hamburger menu */
        width: 100vw; /* Ensure body matches viewport width */
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    .retro-nav {
        width: 100vw; /* Full viewport width */
        height: 60px;
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto; /* Override top: 0 from desktop */
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        border-left: none;
        border-top: 2px solid var(--border);
        background: var(--nav-capsule);
        z-index: 1000;
        padding: 0 20px;
        box-sizing: border-box; /* Include padding in width */
    }

    .nav-container {
        flex-direction: row;
        gap: 12px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        width: 100%;
        justify-content: flex-end;
        box-sizing: border-box; /* Include padding in width */
    }

    .burger-menu {
        display: block; /* Show hamburger on mobile */
    }

    .nav-links {
        display: none; /* Hide by default on mobile */
    }

    .retro-section {
        padding: 24px 12px; /* Adjusted padding for mobile */
        min-height: calc(100vh - 60px); /* Account for navbar height */
        width: 100vw; /* Full viewport width */
        box-sizing: border-box; /* Include padding in width */
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    #home::before {
        width: 80%; /* Smaller on mobile */
        max-width: 300px; /* Constrain size */
        height: 80%; /* Smaller on mobile */
        max-height: 300px; /* Constrain size */
        opacity: 0.4; /* Slightly lower opacity for mobile */
    }

    .retro-card {
        padding: 16px;
        margin: 12px 0;
        border-radius: 12px;
        width: 100%; /* Ensure card spans container */
        max-width: 100%; /* Prevent exceeding viewport */
        box-sizing: border-box; /* Include padding in width */
    }

    .retro-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 12px;
        width: 100%; /* Full width */
        max-width: 100%; /* Prevent exceeding viewport */
        box-sizing: border-box; /* Include padding in width */
    }

    .retro-grid .retro-card {
        min-height: 250px; /* Smaller height for mobile */
        width: 100%; /* Full width */
        box-sizing: border-box; /* Include padding in width */
    }

    .release-notes-grid {
        gap: 12px; /* Smaller gap on mobile */
        width: 100%; /* Full width */
        max-width: 100%; /* Prevent exceeding viewport */
        box-sizing: border-box; /* Include padding in width */
    }

    .release-note-card {
        min-height: 250px; /* Match retro-grid cards on mobile */
        width: 100%; /* Full width */
        box-sizing: border-box; /* Include padding in width */
    }

    .release-note-editor {
        min-height: 150px; /* Smaller for mobile */
        max-height: 200px;
        width: 100%; /* Full width */
        box-sizing: border-box; /* Include padding in width */
    }

    .retro-button {
        padding: 8px 16px;
        font-size: 14px;
    }

    .retro-button:hover {
        box-shadow: 0 0 10px var(--accent), 0 0 15px rgba(29, 29, 29, 0.5); /* Reduced glow for mobile */
        transform: scale(1.03) translateY(-1px); /* Subtler bounce */
        animation: pulseGlow 1.5s ease-in-out infinite;
    }

    .retro-heading {
        font-size: 36px; /* Smaller for mobile */
    }

    .retro-subheading {
        font-size: 24px;
    }

    .retro-h3 {
        font-size: 22px;
    }

    .retro-text, .retro-list li {
        font-size: 16px; /* Adjusted for mobile readability */
    }

    .retro-404 {
        flex-direction: column;
        padding: 24px;
        width: 100vw; /* Full viewport width */
        box-sizing: border-box; /* Include padding in width */
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    .retro-404-image {
        width: 200px;
        height: 200px;
        margin: 0 auto 16px;
    }

    .retro-404-text {
        font-size: 48px;
    }
}