@import url('modules/musicPlayer.css');

/* --- Global, Card, Dark Mode, Header, Links, Music Player --- */
/* ---------------- Overflow Fix ---------------- */
html, body { margin: 0; padding: 0; height: 100%; }
/* ---------------- Global & Card Layout ---------------- */
body { display: flex; align-items: flex-start; justify-content: flex-start; min-height: 100vh; background: #000000; font-family: Arial, sans-serif; transition: background 0.3s, color 0.3s; overflow-x: hidden; position: relative; }

/* ========== ANIMATED GRID BACKGROUND ========== */
.animated-grid-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.grid-base {
    position: absolute;
    inset: 0;
    background: #000000;
}

.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: clamp(20px, 4vw, 40px) clamp(20px, 4vw, 40px);
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #000000, transparent, transparent);
    opacity: 0.8;
}

/* Dark mode grid adjustments */
body.dark .grid-pattern {
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
}

/* Performance optimizations */
.grid-pattern {
    contain: strict;
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .grid-pattern {
        background-size: clamp(15px, 6vw, 30px) clamp(15px, 6vw, 30px);
        transition-duration: 0.2s;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .grid-pattern {
        transition: none;
        transform: none !important;
    }
    .animated-grid-background {
        pointer-events: none;
    }
}

/* High-contrast mode adjustments */
@media (prefers-contrast: high) {
    .grid-pattern {
        background-image: 
            linear-gradient(to right, rgba(255, 255, 255, 0.3) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 1px, transparent 1px);
    }
    
    body.dark .grid-pattern {
        background-image: 
            linear-gradient(to right, rgba(255, 255, 255, 0.4) 1px, transparent 1px),
            linear-gradient(to bottom, rgba(255, 255, 255, 0.4) 1px, transparent 1px);
    }
}
.main-container {
    width: 100%;
    /* Dynamic max-width based on viewport - scales from 95% to 98% of viewport width */
    max-width: min(98vw, 1600px);
    /* Responsive padding using clamp() - smaller on narrow screens */
    padding: clamp(10px, 2vw, 20px);
    margin-top: 5px;
    box-sizing: border-box;
    display: block;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    /* Prevent horizontal overflow */
    overflow-x: hidden;
    /* Ensure content appears above animated grid */
    z-index: 1;
}
.card {
    background: rgba(255, 255, 255, 0.9); border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); max-width: 800px; width: 100%; padding: 20px; box-sizing: border-box; transition: background 0.3s, box-shadow 0.3s;
    position: relative; /* Needed for absolute positioned dark mode toggle */
}
.section { margin-bottom: 20px; }
.section:not(:first-child):not(:last-child) { border-bottom: 1px solid #000; padding-bottom: 20px; }

/* ---------------- Dark Mode Toggle (Absolute inside Card) ---------------- */
.dark-mode-toggle {
    position: absolute;
    top: 15px; right: -15px;
    transform: rotate(90deg); transform-origin: center;
    z-index: 1000; /* Below backdrop/tooltip */
    cursor: pointer;
    width: 60px; height: 30px;
}
.toggle-switch { width: 100%; height: 100%; background: #ccc; border-radius: 30px; position: relative; display: flex; align-items: center; justify-content: space-between; padding: 0 5px; box-shadow: 0 0 5px rgba(0,0,0,0.2); transition: background 0.3s; box-sizing: border-box; }
.toggle-switch .sun, .toggle-switch .moon { font-size: 14px; z-index: 2; }
.toggle-switch .sun { transform: rotate(-90deg); }
.toggle-switch .moon { transform: rotate(-90deg); }
.toggle-switch .slider { position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; background: #fff; border-radius: 50%; transition: 0.3s ease; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
body.dark .toggle-switch { background: #555; }
body.dark .toggle-switch .slider { left: calc(100% - 28px); background: #222; }


/* ---------------- Dark Mode Theme ---------------- */
body.dark { background: #000000 !important; color: #f1f1f1; }
body.dark .card, body.dark .subcard { background: rgba(30, 30, 30, 0.9); box-shadow: 0 2px 10px rgba(255,255,255,0.1); }
body.dark .track-name, body.dark .volume-percentage, body.dark .volume-label, body.dark .links-inner a { color: #fff !important; } /* Updated selector */
body.dark .toggle-button { border-color: #fff; }
body.dark .section:not(:first-child):not(:last-child) { border-bottom-color: #555; }
body.dark #progressBar::-webkit-slider-thumb { background: #fff; }
body.dark .toggle-button { border-color: #fff; background: #333; }
body.dark .toggle-button svg { fill: #fff; }
body.dark .toggle-button.active { background: #fff; }
body.dark .toggle-button.active svg { fill: #000; }
body.dark #volumeSlider::-webkit-slider-runnable-track { background: #777; }
body.dark #volumeSlider::-webkit-slider-thumb { background: #222; border: 2px solid #fff; }
body.dark .volume-control-container { background: linear-gradient(135deg, #3a3a3a 0%, #222 100%); border: 1px solid #555; box-shadow: inset 2px 2px 5px rgba(0,0,0,0.5), inset -2px -2px 5px rgba(255,255,255,0.1); }
body.dark .volume-control-container::before { background: #fff; opacity: 0.15; }
body.dark .links-container::before { background: linear-gradient(to right, rgba(30, 30, 30, 1), rgba(30, 30, 30, 0)); }
body.dark .links-container::after { background: linear-gradient(to left, rgba(30, 30, 30, 1), rgba(30, 30, 30, 0)); }
/* Dark mode for progress bar - Ensure text is white */
body.dark .retro-progress-section { background: rgba(0,0,0,0.6); }
body.dark .progress-bar-retro-container { border-color: #aaa; background-color: #222; }
body.dark .progress-bar-retro-text { color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,0.8); }
/* Dark mode for popup */
body.dark .empty-popup { background: rgba(200,200,200,0.9); color: #000; }


/* ---------------- Section 1: Profile Header ---------------- */
/* --- Base Variables --- */
:root {
    --pfp-size: 160px;
    --frame-width-offset: 10px; /* Adjust if frame image has transparency */
    --frame-height-offset: 18px; /* Adjust if frame image has transparency */
    --frame-width: calc(var(--pfp-size) + var(--frame-width-offset));
    --frame-height: calc(var(--pfp-size) + var(--frame-height-offset));
    --pfp-container-width: var(--frame-width);
    --pfp-container-height: var(--frame-height);

    /* Header dimension variables */
    --header-actual-top-offset: 16px; /* .site-header top value */
    --header-content-height: 56px;   /* .header-container height */
    --header-total-clearance-height: calc(var(--header-actual-top-offset) + var(--header-content-height)); /* Should be 72px */
}
.profile-header { padding-bottom: 10px; }
.profile-container {
    display: flex; align-items: center; justify-content: center; min-height: var(--pfp-container-height); position: relative;
}
.profile-pic {
    position: relative; width: var(--pfp-container-width); height: var(--pfp-container-height); filter: drop-shadow(0 0 0.25rem gray); flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin: 0 auto; overflow: hidden;
}
/* PFP Image */
.pfp-fallback {
    width: var(--pfp-size); height: var(--pfp-size); display: block; border: none; position: relative; z-index: 0; margin-top: calc(var(--frame-height-offset) / 2 - 3px); margin-left: calc(var(--frame-width-offset) / 2 - 5px);
}
/* Frame Overlay */
.frame-overlay {
    position: absolute; top: 0; left: 10; width: 110%; height: 105%; pointer-events: none; z-index: 2; background-size: 100% 100%; background-image: url('../assets/frame/dvd.png'); background-repeat: no-repeat;
}
/* --- Retro Progress Bar Styles (Positioned inside .profile-pic) --- */
.retro-progress-section {
    position: absolute; bottom: 5px; left: 5%; width: 90%; padding: 4px; box-sizing: border-box; background: rgba(0,0,0,0.5); z-index: 3; border-radius: 3px; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.progress-bar-retro-container {
    width: 100%; height: 15px; border: 1px solid #555; background-color: #e0e0e0; overflow: hidden; box-sizing: border-box; order: 1;
}
.progress-bar-retro-fill {
    width: 0%; height: 100%; background-color: #4caf50; transition: width 1.5s ease-out 0.5s; background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); background-size: 8px 8px;
}

/* New class for the animated state */
.progress-bar-retro-fill.animate-to-15 {
    width: 15%;
}

.progress-bar-retro-text {
    font-family: 'Courier New', Courier, monospace; font-size: 0.7rem; color: #fff; text-shadow: 1px 1px 1px rgba(0,0,0,0.8); text-align: center; margin-bottom: 1px; order: 0; width: 100%;
}

/* ---------------- Section 3: Blurbs & Links ---------------- */
.blurbs { text-align: center; }
.blurbs .description { font-size: 1rem; margin-bottom: 20px; }
.links-container {
    width: 100%; max-width: 100%; overflow-x: scroll; -webkit-overflow-scrolling: touch;
    white-space: nowrap; cursor: grab; position: relative; /* Needed for popup */
    padding-top: 5px; padding-bottom: 30px; box-sizing: border-box;
    scrollbar-width: none; -ms-overflow-style: none;
}
.links-container::-webkit-scrollbar { display: none; }
.links-container:active { cursor: grabbing; }
.links-container::before, .links-container::after { content: ''; position: absolute; bottom: 30px; top: 5px; width: 50px; pointer-events: none; z-index: 2; transition: opacity 0.3s; opacity: 0; }
.links-container.is-scrollable::before, .links-container.is-scrollable::after { opacity: 1; }
.links-container::before { left: 0; background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)); }
.links-container::after { right: 0; background: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)); }
body.dark .links-container::before { background: linear-gradient(to right, rgba(30, 30, 30, 1), rgba(30, 30, 30, 0)); }
body.dark .links-container::after { background: linear-gradient(to left, rgba(30, 30, 30, 1), rgba(30, 30, 30, 0)); }
.links-inner { display: inline-block; }
.links-inner a { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 12px 18px; /* Increased padding for bigger hitbox */
    text-decoration: none; 
    color: #000; 
    font-weight: bold; 
    transition: color 0.3s, background-color 0.3s; 
    position: relative; 
    z-index: 3; 
    vertical-align: top;
    min-height: 40px; /* Ensure minimum clickable height */
    box-sizing: border-box; /* Include padding in total size */
    border-radius: 4px; /* Subtle rounding for better visual feedback */
}
.links-inner a img { 
    width: 24px; 
    height: 24px; 
    flex-shrink: 0; 
    background: transparent; 
    border: none; 
    outline: none; 
    box-shadow: none; 
    vertical-align: middle;
    margin: 0; /* Ensure no margin gaps */
    padding: 0; /* Ensure no padding gaps */
    display: block; /* Prevent inline spacing issues */
    pointer-events: none; /* Let click events pass through to parent link */
}

/* Enhanced hover effects for better visual feedback */
.links-inner a:hover {
    /* Remove background highlight but keep transition for smoothness */
    transform: translateY(-1px); /* Slight lift effect */
}

body.dark .links-inner a:hover {
    /* No background highlight in dark mode either */
}

/* Ensure text spans don't create gaps in clickable area */
.links-inner a span {
    pointer-events: none; /* Let click events pass through to parent link */
    margin: 0;
    padding: 0;
    display: inline-block;
}

/* Updated Link Popup CSS */
.empty-popup {
    position: absolute;
    top: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    white-space: nowrap;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; /* Added transform for smoother appearance */
    z-index: 1000; /* Ensure it appears above other elements */
}

.empty-popup.show {
    opacity: 1;
    pointer-events: auto;
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; /* Added shake animation */
    transform: translateX(-50%) translateY(0); /* Adjust transform for show state */
}

/* Keyframes for shake animation (optional, but nice) */
@keyframes shake {
    10%, 90% {
        transform: translateX(-51%) translateY(0);
    }
    20%, 80% {
        transform: translateX(-49%) translateY(0);
    }
    30%, 50%, 70% {
        transform: translateX(-52%) translateY(0);
    }
    40%, 60% {
        transform: translateX(-48%) translateY(0);
    }
}

.links-inner a {
    position: relative; /* Crucial for positioning the popup relative to the link */
}

/* ---------------- Section 4: Vinyl Showcase --- */
.vinyl-section { 
    text-align: center; 
    margin-top: 20px; 
    padding: 5px 0; 
    margin-bottom: 20px; /* Add bottom margin to prevent overlap */
}
.subcard { background: rgba(255, 255, 255, 0.95); border-radius: 8px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin: 0 auto; max-width: 100%; }
.coverflow { position: relative; height: 270px; margin: 0 auto; perspective: 1500px; overflow: hidden; cursor: grab; transition: height 0.3s ease, perspective 0.3s ease; }
.coverflow:active { cursor: grabbing; }
.carousel { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; display: flex; align-items: center; justify-content: center; }
.cover { position: absolute; width: 200px; height: 200px; transform-origin: center center; transition: transform 0.2s ease-out, opacity 0.2s ease-out, width 0.3s ease, height 0.3s ease; opacity: 0.6; }
.cover.active { opacity: 1; }
.cover img { width: 100%; height: 100%; display: block; }
.reflection { position: absolute; width: 100%; height: 50px; bottom: -50px; overflow: hidden; opacity: 0.3; transition: height 0.3s ease, bottom 0.3s ease, width 0.3s ease; }
.reflection img { width: 100%; height: 200px; object-fit: cover; transform: scaleY(-1); display: block; transition: height 0.3s ease; }
.reflection::after { content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0)); }
#album-info { text-align: center; font-size: 1rem; font-weight: bold; margin-top: 10px; min-height: 2em; }
.vinyl-section .header { margin-top: 5px; font-weight: bold; font-size: 20px }

/* ---------------- Music Player Styles --- */
.music-player-container { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 30px auto; max-width: 600px; }
.music-player-container h3 { margin: 0 0 10px; text-align: center; font-weight: normal; }
.progress-container { width: 100%; max-width: 500px; margin: 10px auto 20px; }
#progressBar { width: 100%; -webkit-appearance: none; appearance: none; background: #ddd; height: 4px; border-radius: 2px; outline: none; cursor: pointer; }
#progressBar::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #000; margin-top: -4px; }
#progressBar::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #000; border: none; cursor: pointer; }
#progressBar::-ms-thumb { width: 12px; height: 12px; border-radius: 50%; background: #000; border: none; cursor: pointer; }
.music-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 30px; flex-wrap: wrap; }
.toggle-button { width: 32px; height: 32px; border: 2px solid #000; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color 0.3s, background 0.3s, fill 0.3s; padding: 0; }
.toggle-button svg { width: 16px; height: 16px; fill: #000; transition: fill 0.3s; }
.toggle-button.active { background: #000; }
.toggle-button.active svg { fill: #fff; }
#prevBtn svg { transform: scaleX(-1); }
#downloadBtn svg { width: 18px; height: 18px; }
.track-name { font-size: 1.1rem; font-weight: bold; color: #000; margin-bottom: 15px; text-align: center; transition: color 0.3s; min-height: 1.2em; display: block; }
.ipod-container { position: relative; width: 180px; margin: 0 auto; }
.ipod-image { display: block; width: 100%; height: auto; position: relative; z-index: 1; }
#visualizer { position: absolute; top: 16px; left: 18.7px; width: 140px; height: 108px; background: #000; z-index: 2; border-radius: 5px; }
.cd-wrapper { position: absolute; bottom: -40px; left: 50%; transform: translateX(-50%); width: 120px; z-index: 0; }
.cd-insert { width: 100%; height: auto; display: block; }
@keyframes cd-insert-animation { 0% { transform: translateX(-50%) translateY(-50px); opacity:0; } 50% { transform: translateX(-50%) translateY(0); opacity:1; } 100% { transform: translateX(-50%) translateY(0); opacity:1; } }
.cd-wrapper.insert { animation: cd-insert-animation 800ms ease forwards; }
.ipod-volume-row { display: flex; align-items: center; justify-content: center; gap: 20px; margin-top: 20px; }
.volume-control-container { position: relative; width: 70px; height: 220px; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: linear-gradient(135deg, #c8c8c8 0%, #f2f2f2 100%); border: 1px solid #aaa; box-shadow: inset 2px 2px 5px rgba(0,0,0,0.2), inset -2px -2px 5px rgba(255,255,255,0.7); }
.volume-control-container::before { content: ""; position: absolute; top: 30px; bottom: 30px; left: 50%; width: 4px; transform: translateX(-50%); background: #000; opacity: 0.15; border-radius: 2px; }
.volume-percentage { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); font-size: 0.8rem; font-weight: bold; color: #000; transition: color 0.3s; }
.volume-label { position: absolute; bottom: 5px; width: 100%; text-align: center; font-size: 0.9rem; font-weight: bold; color: #333; transition: color 0.3s; }
#volumeSlider { -webkit-appearance: none; appearance: none; width: 160px; height: 10px; position: absolute; top: 50%; left: 50%; transform-origin: center center; transform: translate(-50%, -50%) rotate(-90deg); background: transparent; outline: none; cursor: pointer; margin: 0; }
#volumeSlider::-webkit-slider-runnable-track { width: 100px; height: 10px; background: #333; border-radius: 5px; margin: 0 auto; }
#volumeSlider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; background: #fff; border: 2px solid #000; border-radius: 50%; margin-top: -5px; cursor: pointer; }
#volumeSlider::-moz-range-track { width: 100px; height: 10px; background: #333; border-radius: 5px; cursor: pointer; }
#volumeSlider::-moz-range-thumb { width: 20px; height: 20px; background: #fff; border: 2px solid #000; border-radius: 50%; cursor: pointer; }
#volumeSlider::-ms-track { width: 100px; height: 10px; background: transparent; border-color: transparent; color: transparent; cursor: pointer; }
#volumeSlider::-ms-thumb { width: 20px; height: 20px; background: #fff; border: 2px solid #000; border-radius: 50%; cursor: pointer; margin-top: 0px; }
#volumeSlider::-ms-fill-lower, #volumeSlider::-ms-fill-upper { background: #333; border-radius: 5px; }
.section.music-player-container { padding-bottom: 120px; }


/* --- Onboarding Backdrop --- */
#onboarding-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.65); z-index: 1050; opacity: 0; transition: opacity 0.3s ease-in-out; pointer-events: none; display: none;
}
#onboarding-backdrop.show { opacity: 1; pointer-events: auto; }

/* --- Onboarding Tooltip Styles --- */
.onboarding-tooltip {
    position: fixed; background-color: #333; color: #fff; padding: 12px 18px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); font-size: 14px; line-height: 1.5; max-width: 220px; z-index: 1100; opacity: 0; transform: scale(0.95) translateY(-10px); transform-origin: top center; transition: opacity 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); pointer-events: none; display: none; text-align: center;
}
.onboarding-tooltip.show { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }
.onboarding-tooltip .tooltip-arrow {
    position: absolute; width: 0; height: 0; border-style: solid; top: -8px; left: 50%; transform: translateX(-50%); border-width: 0 8px 8px 8px; border-color: transparent transparent #333 transparent;
}
#onboarding-okay-btn {
    display: block; width: calc(100% - 20px); padding: 8px 15px; margin: 15px auto 5px auto; background-color: #555; color: #fff; border: none; border-radius: 5px; font-size: 13px; font-weight: bold; cursor: pointer; transition: background-color 0.2s ease;
}
#onboarding-okay-btn:hover { background-color: #666; }


/* --- Mobile Adjustments --- */
@media (max-width: 600px) {
   /* Profile Header variables - Smaller */
   :root { --pfp-size: 100px; --frame-width-offset: 8px; --frame-height-offset: 12px; }
   .profile-container { flex-direction: column; align-items: center; justify-content: center; padding: 10px; min-height: auto; }
   .pfp-fallback { margin-top: calc(var(--frame-height-offset) / 2 - 2px); margin-left: calc(var(--frame-width-offset) / 2 - 4px); }
   .retro-progress-section { bottom: 3px; left: 5%; width: 90%; gap: 2px; padding: 3px; }
   .progress-bar-retro-container { height: 12px; }
   .progress-bar-retro-text { font-size: 0.6rem; }
   .profile-pic { margin: 0; }
   /* Adjust toggle position */
   .dark-mode-toggle { top: 5px; right: -10px; }
   /* Hide Link Text */
   .links-inner a span { display: none; }
   .links-inner a { 
       padding: 12px 16px; /* Increased mobile padding for larger hitbox */
       gap: 0; 
       min-height: 44px; /* iOS recommended minimum touch target */
   }
   /* Vinyl Showcase Mobile Adjustments */
   .coverflow { 
       height: 240px; /* Reduced from 260px to prevent overlapping */
       perspective: 900px; /* Adjusted for smaller height */
       margin: 0 auto 20px auto; /* Added bottom margin for spacing */
   }
   .cover { 
       width: 130px; /* Reduced from 140px */
       height: 130px; 
   }
   .reflection { 
       width: 130px; 
       height: 40px; /* Reduced from 45px */
       bottom: -40px; 
   }
   .reflection img { 
       height: 130px; /* Match cover height */
   }
   /* Adjust tooltip width/positioning slightly if needed */
    .onboarding-tooltip { max-width: 180px; font-size: 13px; }
    #onboarding-okay-btn { font-size: 12px; padding: 6px 12px;}

}

/* Adjustments for Desktop (Ensure no mobile styles leak) */
@media (min-width: 601px) {
    /* Reset PFP margin */
    .pfp-fallback { margin-top: calc(var(--frame-height-offset) / 2 - 3px); margin-left: calc(var(--frame-width-offset) / 2 - 5px); }
    /* Restore desktop progress bar size/gap */
     .retro-progress-section { bottom: 5px; left: 5%; width: 90%; gap: 3px; padding: 4px; }
     .progress-bar-retro-container { height: 15px; }
     .progress-bar-retro-text { font-size: 0.7rem; }
    .profile-pic { margin: 0 auto; }
     .profile-container { padding: 0; flex-direction: row; align-items: center; justify-content: center; min-height: var(--pfp-container-height); }
     /* Restore toggle position */
     .dark-mode-toggle { top: 15px; right: -15px; }
     /* Restore tooltip arrow */
     .onboarding-tooltip .tooltip-arrow { left: 50%; /* Ensure centered on desktop */ }
}

/* === WIDESCREEN OPTIMIZATIONS === */
/* For 1920×1200 and similar widescreen displays */
@media (min-width: 1600px) and (min-height: 1000px) {
    .main-container {
        /* Utilize more horizontal space on very wide screens */
        max-width: min(95vw, 1800px);
    }
    
    .home-content-wrapper {
        /* Slightly larger side panels on widescreen */
        grid-template-columns: 
            clamp(300px, 20vw, 350px)  /* Larger left panel */
            1fr                        /* Center remains flexible */
            clamp(320px, 22vw, 380px); /* Larger right panel */
        gap: clamp(20px, 2.5vw, 30px); /* Larger gaps */
    }
}

/* Specific optimization for 16:10 aspect ratios (like 1920×1200) */
@media (min-width: 1800px) and (max-height: 1300px) {
    .main-container {
        /* Better utilization of 16:10 screen real estate */
        max-width: 92vw;
        padding: clamp(15px, 1.5vw, 20px);
    }
    
    .home-content-wrapper {
        grid-template-columns: 
            clamp(280px, 17vw, 320px)  /* Optimal left panel for 16:10 */
            1fr                        /* Flexible center content */
            clamp(300px, 19vw, 350px); /* Right panel sized for aspect ratio */
        gap: clamp(18px, 2.2vw, 28px);
    }
    
    .tracklist-panel {
        /* ENHANCED FLUID HEIGHT for 16:10 screens - more vertical space efficient */
        /* Improved viewport responsiveness with smoother scaling */
        height: clamp(350px, 35vh, 450px);
        /* Enhanced fluid padding for 16:10 aspect ratio */
        padding: clamp(12px, 1.8vw, 18px);
        /* Optimized width scaling for widescreen */
        width: clamp(280px, 17vw, 320px);
    }
}

/* For ultra-wide displays (21:9, 32:9) */
@media (min-width: 2400px) {
    .home-content-wrapper {
        /* Four-column layout for ultra-wide screens */
        grid-template-columns: 
            clamp(300px, 15vw, 350px)  /* Left tracklist */
            1fr                        /* Main content */
            clamp(300px, 15vw, 350px)  /* Additional widget space */
            clamp(300px, 15vw, 320px); /* Right clock widget */
        max-width: 90vw;
    }
}

/* Typing Effect Styles - Updated for Vertical Scroll */
.typing-effect {
  display: flex;
  align-items: center;
  font-size: 1.8rem; /* Slightly larger for impact */
  font-family: 'Arial', sans-serif; /* Or your preferred font */
  position: relative; 
  width: auto;
  justify-content: center;
  margin-top: 20px;
  color: #000; /* Default text color for the static part */
}

body.dark .typing-effect {
    color: #fff; /* Text color for static part in dark mode */
}

.typing-effect .static-text {
  font-weight: 400;
  margin-right: 0.5em;
  white-space: nowrap;
}

.typing-effect .dynamic-text-wrapper {
  height: calc(1.8rem * 1.2 * 3); /* Show 3 lines: current, one above, one below */
  line-height: 1.2;
  overflow: hidden;
  position: relative;
  text-align: left;
}

.typing-effect .dynamic-text {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative; /* Crucial for the translateY animation */
  /* The animation will be applied here by JS or a CSS keyframe if preferred */
  /* transition: transform 0.5s ease-in-out; */ /* If JS handles transform directly */
}

.typing-effect .dynamic-text li {
  height: calc(1.8rem * 1.2);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  opacity: 0.3; /* Default for non-active, non-focused items */
  transition: opacity 0.4s ease-in-out, color 0.4s ease-in-out, font-weight 0.4s ease-in-out;
  will-change: opacity, transform; /* Performance hint */
  white-space: nowrap;
}

.typing-effect .dynamic-text li.active-text-item {
  opacity: 1;
  color: #6b5bf5; /* Your highlight color */
  font-weight: bold;
}

.typing-effect .dynamic-text li.visible-neighbor {
  opacity: 0.3; /* Opacity for items above/below the active one */
}

/* JS will add/remove these classes and handle transform for scrolling */

/* Remove old animation and cursor if they were there */
@keyframes slideUp {
  /* This will be controlled by JS if we want granular opacity */
}
.dynamic-text li span::after { 
  display: none; 
}

@media (max-width: 600px) {
  .typing-effect {
    font-size: 1.3rem;
    flex-direction: column;
    align-items: center;
  }
  .typing-effect .static-text {
    margin-right: 0;
    margin-bottom: 0.3em;
  }
  .typing-effect .dynamic-text-wrapper {
    height: calc(1.3rem * 1.2 * 3); /* Adjust for mobile font size */
    width: 100%;
    max-width: 300px; /* Prevent very wide text on mobile */
    text-align: center;
  }
  .typing-effect .dynamic-text li {
    height: calc(1.3rem * 1.2);
    justify-content: center;
  }
}

/* ---------------- Site Header Styles ---------------- */
.site-header {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 100%;
  max-width: 1200px;
  padding: 0 16px;
}

.header-container {
  display: flex;
  height: 56px;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  padding: 0 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative; /* Make this a positioning context for the mobile nav dropdown */
  box-sizing: border-box; /* Ensure height includes border */
}

body.dark .header-container {
  background: rgba(30, 30, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px; /* Add gap for spacing between buttons */
}

.mobile-tracklist-button {
  display: none; /* Hidden by default */
  cursor: pointer;
  padding: 8px;
  z-index: 1001; /* Ensure it's clickable */
  position: relative;
}

.mobile-tracklist-button img {
  width: 24px;
  height: 24px;
}

.mobile-menu-button {
  display: none;
  flex-direction: column;
  cursor: pointer;
  margin-right: 8px;
  z-index: 1002; /* Ensure it's above other elements */
  position: relative;
}

.mobile-menu-button span {
  width: 20px;
  height: 2px;
  background: #000;
  margin: 2px 0;
  transition: 0.3s;
}

body.dark .mobile-menu-button span {
  background: #fff;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  width: 28px;
  height: 28px;
  image-rendering: pixelated;
}

/* Header Progress Bar Styles */
.header-progress-bar {
  position: relative;
  bottom: auto;
  left: auto;
  width: 130px;
  background: rgba(0,0,0,0.3);
  margin-left: 8px;
  border-radius: 4px;
  padding: 3px;
  margin-top: -1px;
}

.header-progress-bar .progress-bar-retro-text {
  font-size: 8px;
  margin-bottom: 2px;
}

.header-progress-bar .progress-bar-retro-container {
  height: 8px;
}

body.dark .header-progress-bar {
  background: rgba(255,255,255,0.2);
}

@media (max-width: 600px) {
  .header-progress-bar {
    width: 100px;
    padding: 2px;
  }
  
  .header-progress-bar .progress-bar-retro-text {
    font-size: 6px;
  }
  
  .header-progress-bar .progress-bar-retro-container {
    height: 6px;
  }
}

.site-name {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(to right, violet, indigo, blue, green, yellow, orange, red);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% auto;
  animation: rainbow-flow 8s linear infinite;
  font-family: 'Orbitron', monospace;
  letter-spacing: 0.1em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex: 1;
  justify-content: center;
  margin: 0 32px;
}

.nav-link {
  display: inline-flex; /* Changed to flex for better control */
  align-items: center; /* Center content vertically */
  padding: 12px 16px; /* Increased padding for larger hitbox */
  text-decoration: none;
  color: white; /* Make text white */
  font-weight: 500;
  min-height: 40px; /* Ensure minimum clickable height */
  box-sizing: border-box; /* Include padding in total size */
  border-radius: 4px; /* Subtle rounding */
  gap: 6px; /* Space between icon and text */
  font-size: 15px;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
}

body.dark .nav-link {
  color: white; /* Make text white */
}

.nav-link:hover {
  /* Remove background highlight but keep for transition smoothness */
}

/* Ensure images in nav links don't create dead zones */
.nav-link img {
  pointer-events: none; /* Let click events pass through to parent link */
  margin: 0;
  padding: 0;
  display: block; /* Prevent inline spacing issues */
  vertical-align: middle;
}

/* AGGRESSIVE fix for logo section link hitbox - ig.ico */
.logo-section-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px 18px !important; /* Extra large padding for bulletproof hitbox */
  min-height: 48px !important;
  min-width: 48px !important;
  box-sizing: border-box !important;
  border-radius: 6px !important;
}

/* Force logo section div to be non-blocking */
.logo-section {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  pointer-events: none !important; /* Critical - let clicks pass through */
  margin: 0 !important;
  padding: 0 !important;
}

/* Force logo image to be non-blocking */
.logo-section-link img,
.header-logo {
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  width: 28px !important; /* Ensure consistent size */
  height: 28px !important;
  object-fit: contain !important;
}

/* SPECIFIC FIXES for problematic links */

/* Fix black.gif (playground link) in header */
a[href="./playground/index.html"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 14px 18px !important; /* Extra large padding for better hitbox */
  min-height: 44px !important;
  min-width: 44px !important; /* Ensure minimum touch target */
  box-sizing: border-box !important;
  border-radius: 4px !important;
}

a[href="./playground/index.html"] img {
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  /* Override inline styles that might cause gaps */
  height: 20px !important;
  width: auto !important;
  object-fit: contain !important;
}

/* Aggressive fix for ALL header navigation links */
.header-nav a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px 20px !important; /* Extra large padding */
  min-height: 48px !important;
  min-width: 48px !important;
  box-sizing: border-box !important;
  border-radius: 6px !important;
}

/* Force ALL header nav images to be non-blocking */
.header-nav a img,
.header-left a img {
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  object-fit: contain !important;
  /* Override any inline styles */
  height: 20px !important;
  width: auto !important;
}

/* Force ALL divs inside header links to be non-blocking */
.header-left a div,
.header-nav a div {
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Fix all social media links more aggressively - broader targeting */
.links-inner a[href="#"],
.links-inner a[target="_blank"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: 15px 22px !important; /* Very large padding for bulletproof hitbox */
  min-height: 48px !important;
  min-width: 48px !important;
  box-sizing: border-box !important;
  gap: 10px !important;
  border-radius: 6px !important;
}

/* Force all images in social links to be non-blocking */
.links-inner a img {
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

/* Additional specific fix for ig.ico in case it appears elsewhere */
img[src*="ig.ico"] {
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  object-fit: contain !important;
}

/* Bulletproof fix for any link containing ig.ico */
a[href="./index.html"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px 18px !important;
  min-height: 48px !important;
  min-width: 48px !important;
  box-sizing: border-box !important;
  border-radius: 6px !important;
}

/* Force all child elements of home link to be non-blocking */
a[href="./index.html"] * {
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Force all text spans in social links to be non-blocking */
.links-inner a span {
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.dropdown-arrow {
  margin-left: 4px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

.dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  z-index: 10;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

body.dark .dropdown-content {
  background: rgba(40, 40, 40, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-content a {
  display: block;
  padding: 8px 16px;
  text-decoration: none;
  color: white; /* Make text white */
  font-size: 14px;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.dropdown-content a:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

body.dark .dropdown-content a:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

body.dark .dropdown-content a {
  color: white; /* Make text white */
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
}

.dashboard-link {
  margin-right: 8px;
}

.btn-primary {
  background: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.wiggle-btn {
  animation: wiggle 1s ease-in-out;
  animation-delay: 6s;
  animation-iteration-count: infinite;
}

.btn-ghost {
  background: transparent;
  color: inherit;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.dark .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-outline {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(0, 0, 0, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

body.dark .btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.dark .btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Update dark mode toggle for header */
#headerDarkToggle {
  position: relative;
  transform: none;
  top: auto;
  right: auto;
  width: 40px;
  height: 24px;
  margin-left: 8px;
  cursor: pointer;
}

#headerDarkToggle .toggle-switch {
  width: 100%;
  height: 100%;
  background: #ccc;
  border-radius: 30px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  box-shadow: 0 0 5px rgba(0,0,0,0.2);
  transition: background 0.3s;
  box-sizing: border-box;
}

#headerDarkToggle .toggle-switch .sun,
#headerDarkToggle .toggle-switch .moon {
  font-size: 10px;
  z-index: 2;
  transform: none;
}

#headerDarkToggle .toggle-switch .slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

body.dark #headerDarkToggle .toggle-switch {
  background: #555;
}

body.dark #headerDarkToggle .toggle-switch .slider {
  left: calc(100% - 22px);
  background: #222;
}

/* Animations */
@keyframes rainbow-flow {
  to {
    background-position: 200% center;
  }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

/* Adjust main container for fixed header */
.main-container {
  padding-top: calc(var(--header-total-clearance-height) + 20px); /* Use new variable, e.g., 72px + 20px = 92px */
}

/* Mobile responsive */
@media (max-width: 768px) {
  .mobile-menu-button {
    display: flex;
    z-index: 1001; /* Ensure burger is above menu and overlay */
  }

  .mobile-tracklist-button {
    display: block; /* Show on mobile */
  }
  
  .header-nav {
    /* Reset previous styles */
    display: flex; /* Use flex for internal alignment */
    flex-direction: column;
    position: fixed; /* Changed from absolute */
    top: 0;
    left: 0;
    width: 75%; /* Adjust as needed, e.g., 280px or 80% */
    max-width: 300px; /* Max width for larger mobile screens */
    height: 100%; /* Full height */
    background: #f8f8f8; /* Light iOS-like background */
    backdrop-filter: none; /* Remove blur if it was there for mobile */
    border-radius: 0; /* No border radius for a sidebar */
    margin-top: 0;
    padding-top: 80px; /* Increased top padding */
    padding-bottom: 20px;
    padding-left: 0; /* Ensure no horizontal padding on the nav itself */
    padding-right: 0;
    box-shadow: 4px 0px 15px rgba(0, 0, 0, 0.1); /* iOS-like shadow */
    z-index: 1000; /* Ensure it's above most content */
    opacity: 1; /* Ensure it's opaque */
    visibility: visible; /* Base visibility */
    transform: translateX(-100%); /* Initially off-screen to the left */
    transition: transform 0.3s ease-in-out;
    pointer-events: auto; /* Allow interaction when shown */
    overflow-y: auto; /* Allow scrolling for long menus */
    box-sizing: border-box; /* Crucial for height and padding calculation */
  }
  
  body.dark .header-nav {
    background: #1c1c1e; /* Dark iOS-like background */
    box-shadow: 4px 0px 15px rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border for dark mode */
  }
  
  .header-nav.active {
    transform: translateX(0); /* Slide in */
  }

  /* Styling for items inside the new sidebar */
  .header-nav > a.nav-link,
  .header-nav > .dropdown > .dropdown-trigger, /* Target the trigger for direct styling */
  .header-nav .dropdown-content a {
    width: 100%;
    text-align: left; /* iOS items are typically left-aligned */
    padding: 12px 20px; /* iOS-like padding */
    box-sizing: border-box;
    /* Reset rainbow styles for iOS aesthetic */
    background-image: none;
    -webkit-background-clip: initial;
    -webkit-text-fill-color: initial;
    color: #000; /* Default text color for light mode iOS */
  }

  /* Explicitly style the dropdown trigger text, as it's an <a> tag */
  .header-nav > .dropdown > .dropdown-trigger {
     /* padding is already handled by the rule above */
  }

  body.dark .header-nav > a.nav-link,
  body.dark .header-nav > .dropdown > .dropdown-trigger,
  body.dark .header-nav .dropdown-content a {
    color: #fff; /* White text for dark mode */
  }

  .header-nav > a.nav-link:hover,
  .header-nav > .dropdown > .dropdown-trigger:hover,
  .header-nav .dropdown-content a:hover {
    /* Remove background highlight but keep structure */
    /* Ensure text color doesn't change on hover unless desired */
    /* color: #000; */ 
  }

  body.dark .header-nav > a.nav-link:hover,
  body.dark .header-nav > .dropdown > .dropdown-trigger:hover,
  body.dark .header-nav .dropdown-content a:hover {
    /* Remove background highlight but keep structure */
    /* color: #fff; */
  }
  
  .header-nav .dropdown-trigger {
    display: flex; /* Allow space-between for arrow */
    justify-content: space-between;
    align-items: center;
    width: 100%;
    color: inherit; /* Inherit color from .dropdown */
    padding: 12px 16px; /* Increased padding for better hitbox */
    min-height: 40px;
    box-sizing: border-box;
  }

  /* Ensure dropdown arrows don't create dead zones */
  .header-nav .dropdown-trigger svg,
  .dropdown-arrow {
    pointer-events: none; /* Let click events pass through */
    margin: 0;
    padding: 0;
  }
  
  .header-nav .dropdown-content {
    position: static; /* No longer absolute dropdown */
    width: 100%;
    box-shadow: none;
    margin-top: 0;
    visibility: visible; /* Always visible if parent is */
    opacity: 1;
    transform: none;
    display: none; /* Hidden by default, toggled by JS or .mobile-active */
    background-color: transparent; /* Will be part of the main nav background */
    border: none;
    padding: 0;
  }

  .header-nav .dropdown.mobile-active .dropdown-content {
    display: block; /* Show content when dropdown is active */
    padding-left: 20px; /* Indent dropdown items */
    box-sizing: border-box;
  }
  
  .header-nav .dropdown-content a {
    display: block;
    text-align: left;
    padding: 10px 20px 10px 0; /* Padding for indented items */
    margin: 0; 
    width: 100%; 
    border-radius: 0; 
    /* color is now handled by the more general rules above */
    background-color: transparent; 
    border-bottom: 1px solid rgba(0,0,0,0.05); /* Separator for dropdown items */
  }
  .header-nav .dropdown-content a:last-child {
    border-bottom: none;
  }

  body.dark .header-nav .dropdown-content a {
    /* color is now handled by the more general rules above */
    border-bottom-color: rgba(255,255,255,0.08);
  }

  .header-nav .dropdown-content a:hover {
    /* color and background-color are handled by more general rules */
  }

  body.dark .header-nav .dropdown-content a:hover {
    /* color and background-color are handled by more general rules */
  }
  
  .header-nav .dropdown.mobile-active .dropdown-trigger .dropdown-arrow {
    transform: rotate(90deg); /* Arrow points down for open dropdown */
  }
  
  /* Overlay for when the menu is open */
  #mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* Dimming effect */
    z-index: 999; /* Below the menu but above other content */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
  }

  #mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Prevent body scroll when menu is open */
  body.mobile-menu-open {
    overflow: hidden;
  }
  
  .header-right .dashboard-link,
  .header-right .btn-ghost,
  .header-right .btn-outline {
    display: none;
  }
  
  .btn-primary .full-text {
    display: none;
  }
  
  .site-header {
    top: 8px;
    padding: 0 8px;
  }
  
  .header-container {
    padding: 0 16px;
  }
  
  /* Mobile-specific logo hitbox fixes */
  .logo-section-link {
    padding: 12px 16px !important; /* Slightly larger on mobile */
    min-height: 44px !important; /* iOS touch target guideline */
    min-width: 44px !important;
  }
  
  .header-logo {
    width: 24px !important; /* Slightly smaller on mobile */
    height: 24px !important;
  }
  
  /* Mobile menu active states */
  .mobile-menu-button.active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  
  .mobile-menu-button.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-button.active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

/* Tablet vinyl carousel adjustments */
@media (min-width: 601px) and (max-width: 1024px) {
   .coverflow {
       height: 250px; /* Tablet-specific height */
       perspective: 1200px;
       margin: 0 auto 15px auto;
   }
   
   .cover {
       width: 160px; /* Tablet-specific size */
       height: 160px;
   }
   
   .reflection {
       width: 160px;
       height: 50px;
       bottom: -50px;
   }
   
   .reflection img {
       height: 160px;
   }
   
   .vinyl-section {
       margin-top: 15px; /* Reduced margin for tablets */
       padding: 5px 0;
   }
}

/* Medium screens: Tablets landscape, smaller laptops */
@media (max-width: 1200px) and (min-width: 769px) {
    .home-content-wrapper {
        /* More compact layout for medium screens */
        grid-template-columns: 
            clamp(200px, 16vw, 250px)  /* Smaller left panel */
            1fr                        /* Flexible center */
            clamp(250px, 18vw, 300px); /* Smaller right panel */
        gap: clamp(10px, 1.5vw, 15px);
    }
    
    .tracklist-panel, .clock-widget-panel {
        /* ENHANCED FLUID SCALING for medium screens */
        padding: clamp(8px, 1vw, 12px);
        min-width: 180px;
    }
    
    .tracklist-panel {
        /* OPTIMIZED FLUID HEIGHT for medium screens */
        height: clamp(280px, 32vh, 400px);
        /* Responsive width scaling */
        width: clamp(200px, 16vw, 250px);
    }
}

@media (max-width: 1024px) {
  .dashboard-link {
    display: none;
  }
}

@media (max-width: 640px) {
  .btn-primary .full-text {
    display: none;
  }
  
  .btn-primary .short-text {
    display: inline !important;
  }
}

/* ---------------- Mobile Menu (New Separate Menu) ---------------- */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%; /* Start off-screen to the right */
  width: 80%; /* Or your desired width */
  max-width: 300px; /* Maximum width */
  height: 100%;
  background-color: #fff; /* Example: light background */
  box-shadow: -2px 0 5px rgba(0,0,0,0.1); /* Shadow on the left */
  padding: 20px;
  box-sizing: border-box;
  z-index: 1005; /* Above overlay, below burger if needed */
  transition: right 0.3s ease-in-out;
  overflow-y: auto; /* Allow scrolling for long menus */
}

.mobile-menu.active {
  right: 0; /* Slide in from the right */
}

body.dark .mobile-menu {
  background-color: #1c1c1e; /* Dark mode background */
  box-shadow: -2px 0 5px rgba(0,0,0,0.3);
}

.mobile-menu-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

body.dark .mobile-menu-header {
  border-bottom-color: #333;
}

.mobile-menu-close {
  font-size: 28px;
  font-weight: lighter;
  color: #333;
  cursor: pointer;
  padding: 5px;
}

body.dark .mobile-menu-close {
  color: #ccc;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav-link {
  padding: 12px 0;
  text-decoration: none;
  color: #333; /* Default text color */
  font-size: 16px;
  border-bottom: 1px solid #f0f0f0; /* Light separator */
  transition: background-color 0.2s ease;
}

.mobile-nav-link:last-of-type { /* For direct links, not dropdown container */
  border-bottom: none;
}

.mobile-dropdown { /* Container for dropdown trigger and content */
  border-bottom: 1px solid #f0f0f0;
}
.mobile-dropdown:last-of-type {
   border-bottom: none;
}


body.dark .mobile-nav-link {
  color: #eee; /* Light text for dark mode */
  border-bottom-color: #333;
}

.mobile-nav-link:hover {
  background-color: #f9f9f9;
}

body.dark .mobile-nav-link:hover {
  background-color: #2a2a2e;
}

.mobile-dropdown-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  /* Styles inherited from .mobile-nav-link if it's also a link */
}

.mobile-dropdown-trigger .dropdown-arrow {
  fill: #333;
  transition: transform 0.2s ease;
}

body.dark .mobile-dropdown-trigger .dropdown-arrow {
  fill: #eee;
}

.mobile-dropdown-content {
  display: none; /* Hidden by default */
  padding-left: 15px; /* Indentation for dropdown items */
  margin-top: 5px; /* Space above dropdown items */
}

.mobile-dropdown-content.active {
  display: block; /* Show when active (toggled by JS) */
}

.mobile-dropdown-content a {
  display: block;
  padding: 10px 0; /* Padding for sub-items */
  text-decoration: none;
  color: #555;
  font-size: 15px;
  /* No border needed here if parent .mobile-nav-link has it */
}

body.dark .mobile-dropdown-content a {
  color: #ccc;
}

.mobile-dropdown-content a:hover {
  background-color: #f0f0f0;
}
body.dark .mobile-dropdown-content a:hover {
  background-color: #303035;
}

/* Ensure .mobile-menu-button is displayed at the correct breakpoint */
/* The existing @media (max-width: 768px) already shows .mobile-menu-button */
/* We just need to make sure the old .header-nav is hidden */

@media (max-width: 768px) {
  .header-nav { /* This is your DESKTOP navigation */
    display: none !important; /* Hide desktop nav on mobile */
  }
  /* .mobile-menu-button is already handled to be display:flex */
}

@media (min-width: 769px) {
  .mobile-menu {
    display: none !important; /* Hide mobile menu on desktop */
  }
  .mobile-menu-button {
    display: none !important; /* Hide burger icon on desktop */
  }
  .header-nav { /* This is your DESKTOP navigation */
    display: flex !important; /* Ensure desktop nav is shown */
  }
}

/* -------- New Mobile Menu Dropdown System -------- */
.mobile-menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.mobile-menu-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-menu-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  margin: 8px 16px;
  padding: 16px;
  max-width: 300px;
}

body.dark .mobile-menu-content {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.mobile-nav-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-menu-item {
  position: relative;
}

.mobile-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.6);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.5);
}

.mobile-menu-link:hover {
  color: rgba(0, 0, 0, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.8);
}

body.dark .mobile-menu-link {
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

body.dark .mobile-menu-link:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.mobile-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(0, 0, 0, 0.6);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-menu-trigger:hover {
  color: rgba(0, 0, 0, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.8);
}

body.dark .mobile-menu-trigger {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.6);
}

body.dark .mobile-menu-trigger:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.mobile-nested-content {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition: all 0.2s ease;
  z-index: 1001;
}

body.dark .mobile-nested-content {
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-nested-dropdown:hover .mobile-nested-content,
.mobile-nested-dropdown.active .mobile-nested-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.mobile-submenu-link {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: rgba(0, 0, 0, 0.6);
  font-size: 13px;
  font-weight: 400;
  transition: all 0.2s ease;
  margin-bottom: 4px;
}

.mobile-submenu-link:last-child {
  margin-bottom: 0;
}

.mobile-submenu-link:hover {
  color: rgba(0, 0, 0, 0.8);
  background: rgba(0, 0, 0, 0.05);
}

body.dark .mobile-submenu-link {
  color: rgba(255, 255, 255, 0.6);
}

body.dark .mobile-submenu-link:hover {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-trigger .dropdown-arrow {
  transition: transform 0.2s ease;
}

.mobile-nested-dropdown:hover .dropdown-arrow,
.mobile-nested-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

/* Hide new dropdown mobile menu styles on larger screens */
@media (min-width: 769px) {
  .mobile-menu-dropdown {
    display: none;
  }
}

/* Adjust mobile dropdown for very small screens */
@media (max-width: 480px) {
  .mobile-menu-content {
    margin: 8px 12px;
    max-width: calc(100vw - 24px);
  }
  
  .mobile-nested-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-left: 0;
  }
  
  .mobile-nested-dropdown:hover .mobile-nested-content,
  .mobile-nested-dropdown.active .mobile-nested-content {
    transform: translate(-50%, -50%);
  }
}

/* Bento Style Tracklist Section */
.tracklist-bento-section {
  /* Add some spacing if needed, e.g., margin-top: 20px; */
  /* background-color: var(--background-color-dark); /* Or your preferred section background */
  /* padding: 15px; */
  /* border-radius: var(--card-border-radius); */
  /* box-shadow: var(--shadow-elevation-medium); */
}

.tracklist-bento-section .section-title {
  color: var(--text-color-light);
  margin-bottom: 15px;
  /* text-align: center; /* Or left */
  font-size: 1.5em; /* Adjust as needed */
}

.tracklist-bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Adjust minmax for desired item size */
  gap: 15px; /* Space between bento boxes */
  padding: 10px; /* Padding around the grid */
}

.tracklist-bento-grid .track-item {
  background-color: var(--card-bg-dark-gray); /* From your existing styles, or a new one */
  border: 1px solid var(--border-color-gray); /* From your existing styles, or a new one */
  border-radius: 12px; /* Consistent with bento box style */
  padding: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column; /* Stack elements vertically */
  justify-content: space-between; /* Distribute space */
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  cursor: pointer;
}

.tracklist-bento-grid .track-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.tracklist-bento-grid .track-item.active-track {
  border-left: 5px solid var(--accent-color-green); /* Or your theme's accent color */
  background-color: var(--accent-color-dark-green); /* Slightly different bg for active */
  box-shadow: 0 6px 15px rgba(var(--accent-color-green-rgb), 0.3);
}

.tracklist-bento-grid .track-item .track-number {
  font-size: 0.9em;
  color: var(--text-color-medium-gray);
  margin-bottom: 8px;
}

.tracklist-bento-grid .track-item .track-title {
  font-size: 1.1em;
  color: var(--text-color-light);
  font-weight: bold;
  margin-bottom: 10px;
  flex-grow: 1; /* Allow title to take available space */
  word-break: break-word; /* Prevent long titles from breaking layout */
}

.tracklist-bento-grid .track-item .track-duration {
  font-size: 0.9em;
  color: var(--text-color-medium-gray);
  text-align: right;
  margin-top: auto; /* Push to the bottom */
}

/* Ensure these variables are defined in your :root or adapted */
/* Example variable definitions (add to :root if not present or use your own):
  --card-bg-dark-gray: #2c2c2c;
  --border-color-gray: #444;
  --text-color-medium-gray: #999;
  --accent-color-green: #4CAF50;
  --accent-color-dark-green: #367c39;
  --accent-color-green-rgb: 76, 175, 80;
*/

/* Dynamic Three-column layout for homepage content */
.home-content-wrapper {
    /* Updated for fixed positioned bentos */
    display: block;
    width: 100%;
    /* Center the main content with fixed bentos on sides */
    max-width: 800px;
    margin: 0 auto;
    
    /* Add horizontal margins to avoid overlap with fixed bentos */
    margin-left: max(calc(clamp(250px, 18vw, 300px) + clamp(40px, 4vw, 80px)), auto);
    margin-right: max(calc(clamp(280px, 20vw, 320px) + clamp(40px, 4vw, 80px)), auto);
}

.tracklist-panel {
    background: rgba(20, 20, 30, 0.95);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    /* Responsive padding scales with panel size */
    padding: clamp(10px, 1.5vw, 15px);
    border-radius: 18px;
    /* FLUID RESPONSIVE HEIGHT - Enhanced for smoother animation */
    height: clamp(300px, 40vh, 500px);
    overflow-y: auto;
    
    /* TRUE FIXED ANCHORED POSITIONING */
    position: fixed;
    /* Align with main content card top position */
    top: calc(var(--header-total-clearance-height, 72px) + clamp(15px, 2vw, 25px));
    left: clamp(20px, 2vw, 40px);
    
    /* Improved scroll behavior */
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    
    /* SELECTIVE FLUID ANIMATION - HEIGHT ONLY */
    /* Only animate height changes while maintaining fixed position and width */
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease;
    
    /* Ensure minimum usable width with fluid scaling */
    min-width: 200px;
    width: clamp(250px, 18vw, 300px);
    
    /* Fixed positioning optimization */
    z-index: 100;
    
    /* Enhanced performance for HEIGHT-ONLY animations */
    will-change: height, box-shadow;
    contain: layout style paint;
}

/* FLUID SECTION TITLE STYLING */
.tracklist-panel .section-title {
    /* Fluid responsive font size */
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: clamp(12px, 1.5vw, 18px);
    padding-bottom: clamp(8px, 1vw, 12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    /* SMOOTH TEXT ANIMATION */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
}

/* Enhanced dark mode support */
body.dark .tracklist-panel .section-title {
    color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.15);
}

/* ========== FLUID ANIMATION OPTIMIZATIONS ========== */

/* High DPI and zoom level optimizations */
@media (min-resolution: 2dppx), (min-device-pixel-ratio: 2) {
    .tracklist-panel {
        /* Enhanced smooth rendering on high-DPI displays */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        /* Optimize animations for retina displays */
        backface-visibility: hidden;
        perspective: 1000px;
    }
}

/* Reduced motion support for accessibility */
@media (prefers-reduced-motion: reduce) {
    .tracklist-panel,
    .track-item-card,
    .tracklist-panel .section-title {
        transition: none;
        animation: none;
        will-change: auto;
    }
}

/* Enhanced performance on lower-end devices */
@media (max-width: 768px) {
    .tracklist-panel,
    .clock-widget-panel,
    .track-item-card {
        /* Simplified animations for mobile performance - focus on essential transitions only */
        transition-duration: 0.2s;
        /* Limit will-change to essential properties for better performance */
        will-change: height, transform;
    }
    
    .tracklist-panel {
        /* Mobile tracklist maintains transform animations for slide-in */
        will-change: transform;
    }
}

.main-content-column {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Space between items inside this column */
}

.clock-widget-panel {
    /* TRUE FIXED ANCHORED POSITIONING */
    position: fixed;
    /* Match tracklist panel's positioning - align with main content top */
    top: calc(var(--header-total-clearance-height, 72px) + clamp(15px, 2vw, 25px));
    right: clamp(20px, 2vw, 40px);
    height: fit-content;
    
    /* Improved scroll behavior */
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    
    /* SELECTIVE FLUID ANIMATION - HEIGHT ONLY (matches tracklist) */
    /* Since it uses fit-content height, it will animate when content changes */
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease;
    
    /* Ensure minimum usable width */
    min-width: 250px;
    width: clamp(280px, 20vw, 320px);
    /* Add responsive padding */
    padding: clamp(10px, 1.5vw, 15px);
    
    /* Fixed positioning optimization */
    z-index: 100;
    
    /* Enhanced performance for HEIGHT-ONLY animations */
    will-change: height, box-shadow;
    contain: layout style paint;
}

/* ENHANCED FLUID ANIMATION STYLES for track items */
.track-item-card {
  /* Fluid responsive padding */
  padding: clamp(8px, 1vw, 12px) clamp(10px, 1.2vw, 14px);
  margin-bottom: clamp(6px, 0.8vw, 10px);
  background-color: var(--card-item-bg-color, rgba(255, 255, 255, 0.05));
  border-radius: clamp(6px, 0.8vw, 10px);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* COMPREHENSIVE FLUID TRANSITIONS for smooth animations */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Enhanced performance */
  will-change: transform, background-color, box-shadow;
}

.track-item-card:hover {
  background-color: var(--card-item-hover-bg-color, rgba(255, 255, 255, 0.1));
  /* FLUID HOVER ANIMATION with subtle scale and shadow */
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.track-item-card.playing {
  background-color: var(--primary-accent-color-translucent, rgba(106, 0, 173, 0.3));
  /* FLUID PLAYING STATE with enhanced visual feedback */
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(106, 0, 173, 0.2);
  border-left: 3px solid var(--primary-accent-color, #6A0DAD);
}

.track-item-card:active {
  /* FLUID ACTIVE STATE for touch/click feedback */
  transform: scale(0.98);
  transition-duration: 0.1s;
}

.track-item-name {
  font-size: 0.95em;
  flex-grow: 1;
}

.track-item-drag-handle {
  margin-left: 10px;
  cursor: grab;
  color: var(--icon-color, #a0a0a0);
}

/* Styles for drag & drop feedback */
.track-item-card.dragging {
  opacity: 0.6;
  border: 1px dashed var(--primary-accent-color, #6A0DAD);
  background-color: var(--card-item-bg-color-dragging, rgba(40, 40, 40, 0.5)); /* Darker, more distinct while dragging */
}

.track-item-card.drag-over {
  /* Indicates a potential drop target */
  background-color: var(--card-item-hover-bg-color, rgba(255, 255, 255, 0.15)); 
  /* You could use border-top or border-bottom for more precise drop indication if needed later */
  box-shadow: inset 0 0 0 2px var(--primary-accent-color, #6A0DAD); /* Inset shadow as an alternative to border */
}

/* Custom scrollbar for tracklist (Webkit browsers) */
.tracklist-panel::-webkit-scrollbar {
  width: 6px;
}

.tracklist-panel::-webkit-scrollbar-track {
  background: transparent;
  margin: 18px 0; /* Match border-radius to create rounded appearance */
}

.tracklist-panel::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  border: none;
}

.tracklist-panel::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}


/* Ensure enough space below header */
/* .main-container is already used for this with padding-top */
/* Check if more specificity is needed */
body > .main-container {
    padding-top: calc(var(--header-total-clearance-height) + 20px); /* 20px is the original padding */
}

/* Desktop tracklist visibility - ensure always visible on larger screens */
@media (min-width: 769px) {
    .tracklist-panel {
        display: block !important; /* Override any hidden states */
        position: fixed !important; /* Maintain fixed positioning on desktop */
        transform: none !important; /* Reset any mobile transform */
    }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
  .home-content-wrapper {
    display: block;
    padding: 1px; /* Less padding on mobile */
  }

  .clock-widget-panel {
    display: none; /* Hide clock widget on mobile */
  }

  .tracklist-panel {
    position: fixed;
    top: var(--header-total-clearance-height, 72px); /* Start below header */
    left: 0;
    /* FLUID MOBILE WIDTH for consistent experience */
    width: clamp(260px, 75vw, 320px);
    height: calc(100% - var(--header-total-clearance-height, 72px));
    z-index: 40; /* Below site header (z-index: 50) */
    transform: translateX(-100%);
    /* Mobile: Initially hidden until track.gif is clicked */
    display: none;
    /* ENHANCED MOBILE FLUID TRANSITION */
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #1e1e1e; /* A dark background for the panel */
    box-shadow: 2px 0 5px rgba(0,0,0,0.5);
    /* Enhanced performance optimizations */
    will-change: transform;
    contain: layout style paint;
  }

  .tracklist-panel.is-open {
    display: block !important; /* Ensure it's visible when open */
    transform: translateX(0);
  }

  .main-content-column {
    width: 100%;
  }

  body > .main-container {
    padding-bottom: 80px; /* 60px for player bar + 20px original bottom padding */
  }

  .music-player-container.section { /* Hide desktop music player */
    display: none !important;
  }

  #mobile-music-player-container {
    display: block; /* Show the mobile player container */
  }
}

/* Dark Mode for Tracklist */
body.dark .tracklist-panel {
    background: rgba(30, 30, 40, 0.95);
    border-color: rgba(255, 255, 255, 0.12);
}

.tracklist-panel:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateZ(0) translateY(-2px);
}

/* Enhanced anchoring visual feedback */
.clock-widget-panel:hover {
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.35),
        0 0 20px rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateZ(0) translateY(-2px);
}

/* ========== ENHANCED BENTO ANCHORING SYSTEM ========== */

/* Add scroll-responsive anchoring for bento elements */
.home-content-wrapper {
    /* Add scroll container behavior */
    scroll-behavior: smooth;
}

/* Enhanced anchoring states for better visual feedback */
.tracklist-panel,
.clock-widget-panel {
    /* Interaction state tracking */
    cursor: pointer;
}

/* Active anchoring state - when panels are being interacted with */
.tracklist-panel:active,
.clock-widget-panel:active {
    transform: translateZ(0) scale(0.998);
    transition-duration: 0.1s;
}

/* Focus states for accessibility and anchoring feedback */
.tracklist-panel:focus-within,
.clock-widget-panel:focus-within {
    outline: 2px solid rgba(0, 255, 136, 0.3);
    outline-offset: 2px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.35),
        0 0 25px rgba(0, 255, 136, 0.1);
}

/* Scroll anchor optimization */
.tracklist-panel *,
.clock-widget-panel * {
    scroll-margin-top: calc(var(--header-total-clearance-height, 72px) + 20px);
}

/* Add subtle animation when panels come into view */
@keyframes bentoPanelEntrance {
    from {
        opacity: 0;
        transform: translateZ(0) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateZ(0) translateY(0);
    }
}

/* Apply entrance animation to bento panels */
.tracklist-panel,
.clock-widget-panel {
    animation: bentoPanelEntrance 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

/* Stagger animation for better visual hierarchy */
.clock-widget-panel {
    animation-delay: 0.1s;
}

/* ========== DYNAMIC ANCHORING STATES ========== */

/* Simplified scroll states - removed problematic visual effects */
.tracklist-panel.scroll-active,
.clock-widget-panel.scroll-active {
    /* Removed dynamic shadow effects that cause visual artifacts */
}

/* Anchoring awareness states - simplified */
.tracklist-panel.fully-anchored,
.clock-widget-panel.fully-anchored {
    /* Removed opacity changes that cause highlighting issues */
}

.tracklist-panel.partially-anchored,
.clock-widget-panel.partially-anchored {
    /* Removed opacity changes that cause highlighting issues */
}

/* Enhanced hover state with anchoring */
.tracklist-panel.anchor-hover,
.clock-widget-panel.anchor-hover {
    border-color: rgba(0, 255, 136, 0.2);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.35),
        0 0 25px rgba(0, 255, 136, 0.08);
}

/* Enhanced focus state */
.tracklist-panel.anchor-focused,
.clock-widget-panel.anchor-focused {
    border-color: rgba(0, 255, 136, 0.3);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.35),
        0 0 30px rgba(0, 255, 136, 0.15);
}

/* Responsive anchoring adjustments */
@media (max-width: 1024px) {
    /* On smaller screens, revert to normal layout */
    .home-content-wrapper {
        display: block;
        margin-left: auto;
        margin-right: auto;
        max-width: 90vw;
    }
    
    .tracklist-panel {
        position: relative;
        left: auto;
        top: auto;
        width: 100%;
        margin-bottom: 20px;
        z-index: auto;
    }
    
    .clock-widget-panel {
        position: relative;
        right: auto;
        top: auto;
        width: 100%;
        margin-top: 20px;
        z-index: auto;
    }
}

@media (max-width: 768px) {
    /* Hide clock widget on mobile */
    .clock-widget-panel {
        display: none;
    }
    
    /* ENHANCED MOBILE TRACKLIST with fluid animation */
    .tracklist-panel {
        position: fixed;
        top: var(--header-total-clearance-height, 72px); /* Start below header */
        left: 0;
        /* FLUID MOBILE WIDTH */
        width: clamp(260px, 75vw, 320px);
        height: calc(100vh - var(--header-total-clearance-height, 72px));
        transform: translateX(-100%);
        z-index: 40; /* Below site header (z-index: 50) */
        /* Mobile: Initially hidden until track.gif is clicked */
        display: none;
        /* ENHANCED MOBILE TRANSITION */
        transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        /* Maintain performance optimizations */
        will-change: transform;
        contain: layout style paint;
    }
    
    .tracklist-panel.is-open {
        display: block !important; /* Ensure it's visible when open */
        transform: translateX(0);
    }
}

body.dark .track-item-card {
    background: #2a2a2a;
    border-color: #444;
    color: #f1f1f1; /* Set text color for children */
}

body.dark .track-item-card:hover {
    background: #3a3a3a;
}

body.dark .track-item-card.playing {
    background-color: #1c1c1c;
    border-color: #007bff;
}

/* This is still needed because .track-item-name has a specific color */
body.dark .track-item-name {
    color: #f1f1f1;
}

body.dark .tracklist-panel::-webkit-scrollbar-track {
    background: transparent;
}

body.dark .tracklist-panel::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.4);
}

body.dark .tracklist-panel::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 768px) {
  .blog-card .post-excerpt {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    font-size: 0.8rem;
    -webkit-line-clamp: 2; /* This controls the number of lines */
    line-clamp: 2;
  }
}

#swipe-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 35; /* Below tracklist panel (z-index: 40) */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  /* Hide on desktop - mobile only */
  display: none;
}

#swipe-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile-only swipe overlay */
@media (max-width: 768px) {
  #swipe-overlay {
    display: block; /* Show on mobile */
  }
}
