/* Font settings */
@font-face {
    font-family: 'Macintosh Regular';
    src: url('fonts/macintosh-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* Font settings for pixelated effect */
.pixel-text {
    font-family: 'Macintosh Regular', 'Monaco', 'Lucida Console', 'Courier New', monospace; /* Use retro fonts */
    font-size: 14px; /* Adjust size for better pixelation */
    line-height: .69; /* Keep the lines close together */
    letter-spacing: 0px; /* Slight spacing to mimic pixelated UI */
    transform: scale(1); /* Slightly scales the text to appear thicker */
    color: #333; /* Dark gray for readability */
    /* text-transform: uppercase; /* Optional: makes text look like an old UI */
}

/* Disable font smoothing for pixelation */
.pixel-text {
    -webkit-font-smoothing: none; /* Disable WebKit anti-aliasing */
    -moz-osx-font-smoothing: grayscale; /* Disable macOS font smoothing */
    font-smooth: never; /* General font-smoothing property */
}

/* Reset body styles */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #dadace; /* Light gray background */
    font-family: 'Macintosh Regular', sans-serif;
}

/* Background gravity grid — full-viewport canvas behind the iPod.
   js/grid.js draws the grid and warps it into a depression under the
   cursor, as if the pointer has weight and presses the sheet away from
   the viewer. Sits behind everything; body background paints beneath it. */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

/* Custom warm-white light cursor (fine pointers only; touch keeps native) */
@media (hover: hover) and (pointer: fine) {
    *,
    *::before,
    *::after {
        cursor: none !important;
    }
}

/* Wrapper: JS moves this with a soft trailing lerp and stretches it
   along the direction of movement (translate + rotate + scale) */
.cursor-blob {
    position: fixed;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transform: translate3d(-100px, -100px, 0);
    transition: opacity 0.8s ease;
    mix-blend-mode: plus-lighter;
    will-change: transform, opacity;
}

.cursor-blob.is-visible {
    opacity: 1;
}

/* Core: the light itself — a single, solid orb of mint light. Two layered
   gradients give it volume like a lit sphere rather than a flat glow: a
   dim rim shadow (lower-right, "away" from the light) plus a mint body
   that's brightest near the light side and falls off softly at the edge.
   Its border-radius is driven every frame by JS as one shared, synced
   wobble so the whole silhouette breathes and stretches as one form. */
.cursor-blob-core {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 64% 70%, rgba(14, 90, 72, 0.32) 0%, transparent 58%),
        radial-gradient(
            circle at 40% 36%,
            rgba(15, 150, 95, 0.45) 0%,
            rgba(45, 175, 125, 0.42) 30%,
            rgba(35, 150, 105, 0.28) 55%,
            rgba(25, 130, 90, 0.12) 75%,
            transparent 88%
        );
    box-shadow:
        0 0 10px 3px rgba(70, 175, 125, 0.32),
        0 0 24px 9px rgba(45, 155, 110, 0.16);
    border-radius: 50%;
    filter: blur(2.5px);
    transition: transform 0.7s cubic-bezier(0.33, 1, 0.68, 1);
    animation: cursor-breathe 5.5s ease-in-out infinite;
    will-change: transform, border-radius, filter;
}

/* Highlight: a soft, tinted (never pure-white) specular glint suggesting a
   light source on a rounded surface. JS counter-rotates it against the
   wrapper's rotation so it stays roughly fixed in screen space while the
   body underneath turns/stretches to face movement — the classic cue that
   reads as a lit 3D sphere instead of a flat, rotating decal. */
.cursor-blob-highlight {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(
        circle at 36% 32%,
        rgba(220, 255, 236, 0.32) 0%,
        rgba(205, 250, 228, 0.14) 32%,
        transparent 58%
    );
    will-change: transform;
}

/* Slow breathing — subtle swell and glow */
@keyframes cursor-breathe {
    0%, 100% {
        opacity: 0.7;
        filter: blur(3px);
        transform: scale(0.94);
    }
    50% {
        opacity: 0.88;
        filter: blur(4.5px);
        transform: scale(1.06);
    }
}

@media (hover: none), (pointer: coarse) {
    .cursor-blob {
        display: none;
    }
}

/* iPod Screen */
.ipod-screen {
    width: 300px; /* Fixed width */
    height: 240px; /* Fixed height */
    background-color: #BDBDBD; /* iPod screen color */
    border: 2px solid #000; /* Black border around screen */
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    border-radius: 15px; /* Rounded corners */
    display: flex;
    flex-direction: column; /* Stack elements vertically */
    justify-content: flex-start; /* Spread content evenly */
    align-items: center;
    overflow: hidden; /* Prevent content overflow */
    position: relative; /* For absolute positioning inside */
}

.ipod-body {
    box-sizing: border-box;
    width: 430px;
    height: 711px;
    padding-top: 27px;
    /* More glossy gradient with multiple layers */
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(225deg, rgba(255, 255, 255, 0.2) 0%, transparent 30%),
        linear-gradient(180deg, #E8E8E8, #E0E0E0); /* Lighter bottom */
    border-radius: 30px;
    /* Gradient border effect - darker inside, lighter outside */
    border: 3px solid transparent;
    background-clip: padding-box;
    box-shadow: 
        /* Inner dark shadow for depth */
        inset 0 0 0 1px rgba(0, 0, 0, 0.4),
        inset 0 0 0 2px rgba(0, 0, 0, 0.2),
        /* Outer lighter border */
        0 0 0 1px rgba(255, 255, 255, 0.3),
        0 0 0 2px rgba(0, 0, 0, 0.15),
        /* Glossy highlights */
        inset 0 1px 3px rgba(255, 255, 255, 0.8),
        inset 0 10px 20px rgba(255, 255, 255, 0.3),
        /* Corner shine highlights */
        0 2px 8px rgba(255, 255, 255, 0.4),
        /* Main drop shadow */
        0 6px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Add corner shine effect */
.ipod-body::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 33px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0.4) 15%, 
        transparent 30%, 
        transparent 70%, 
        rgba(255, 255, 255, 0.2) 100%);
    z-index: -1;
    pointer-events: none;
}

/* Add secondary glossy highlight */
.ipod-body::after {
    content: '';
    position: absolute;
    top: 300px; /* Moved below the screen area */
    left: 50px;
    width: 50%;
    height: 30%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 100%);
    z-index: 0;
    pointer-events: none;
}

/* Menu list */
.menu {
    list-style: none;
    padding: 0;
    margin: 0 0 5px;
    width: 100%;
    text-align: left;
    font-weight: normal;
    font-size: 14px;
    color: #333;
}

.menu li {
    font-size: 16px;
    margin: 5px 5px;
    padding: 8px 10px;
    color: #333;
    cursor: pointer;
    position: relative;
    box-sizing: border-box;
}

.menu li:first-child {
    margin-top: 0;
}

.menu li::after {
    content: '>';
    font-size: 16px;
    font-weight: bold;
    color: #000;
    position: absolute;
    right: 15px;
}

/* Highlighted (selected) menu item — visual only, same box size as unselected */
.menu .selected {
    background-color: #333;
    color: #BDBDBD;
    font-weight: normal;
    border-radius: 3px;
}

.menu .selected::after {
    color: #BDBDBD;
}
.click-wheel {
    margin-top: 74px; 
    position: relative;
    width: 284px;
    height: 284px;
    /* Glossy gradient background */
    background: 
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(145deg, #F5F5F5, #E8E8E8);
    border-radius: 50%;
    border: .2px solid #333;
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.2),
        inset 0 -2px 3px rgba(255, 255, 255, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.15);
    cursor: grab;
    transition: transform 0.1s ease;
    user-select: none;
}

.click-wheel:active {
    cursor: grabbing;
}

.ipod-buttons {
    position: relative;
    width: 200px; /* Outer ring size */
    height: 200px;
    margin: 0 auto;
    border-radius: 50%; /* Full circle */
    background: #f9f9f9;
}

.button {
    position: absolute;
    width: 100px;
    height: 30px;
    background: #ddd;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.button:hover {
    background: #ccc;
}

/* Positioning buttons */
.button.center {
    width: 100px;
    height: 100px;
    /* Glossy center button gradient */
    background: 
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.8) 0%, transparent 40%),
        linear-gradient(145deg, #FFFFFF, #F0F0F0);
    border-radius: 50%;
    border: 1px solid #999;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.1),
        inset 0 -1px 2px rgba(255, 255, 255, 0.9),
        0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.1s ease;
    /* Prevent flash by ensuring immediate styling */
    display: block;
    position: absolute;
}

.button.center:hover {
    background: 
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.6) 0%, transparent 40%),
        linear-gradient(145deg, #F8F8F8, #E8E8E8);
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.15),
        inset 0 -1px 2px rgba(255, 255, 255, 0.8),
        0 1px 3px rgba(0, 0, 0, 0.25);
}

.button.center:active {
    background: 
        radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.4) 0%, transparent 40%),
        linear-gradient(145deg, #E8E8E8, #D8D8D8);
    box-shadow: 
        inset 0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 -1px 1px rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%) scale(0.98);
}

/* Top Section (Battery and Title) */
.ipod-top {
    width: 100%;
    padding: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #2F302C; /* Add a subtle separation line */
}

.ipod-top-middle {
    flex-grow: 1; /* Make the middle section take up remaining space */
    display: flex;
    justify-content: center; /* Horizontally center the text */
    align-items: center; /* Vertically center the text */
    text-align: center; /* Ensure text is centered */
    padding-left: 45px;
}

.ipod-top-middle-text {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0; /* Remove margin to ensure perfect centering */
}

.battery {
    width: 40px;
    height: auto; /* Maintain aspect ratio */
    margin-right: 10px; /* Spacing from the edge */
}

/* Main Content Section */
.screen-content {
    flex: 1; /* Take up all available space */
    width: 90%; /* Center content with padding */
    display: flex;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    font-size: 16px;
    color: #333;
    padding: 10px; /* Prevent text from touching edges */
    background-color: #FFF; /* White content area */
}

/* Click Wheel */
.footer {
    width: 100%;
    padding: 10px;
    font-size: 12px;
    color: #666;
    text-align: center;
    background-color: #BDBDBD; /* Match iPod screen color */
    border-top: 2px solid #333; /* Add a subtle separation line */
}

/* Now Playing Styles */
.now-playing-content {
    flex: 1;
    width: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px 20px;
    text-align: center;
}

.track-info {
    margin-bottom: 20px;
    width: 100%;
}

.track-number {
    font-size: 11px;
    margin-bottom: 15px;
    text-align: right;
}

.song-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.artist-name {
    font-size: 14px;
    margin-bottom: 8px;
}

.album-name {
    font-size: 12px;
    margin-bottom: 20px;
}

/* Progress Bar */
.progress-container {
    margin: 20px 0;
    width: 100%;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #999;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 35%; /* Represents current progress */
    height: 100%;
    background-color: #333;
    border-radius: 2px;
}

/* Time Display */
.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin: 15px 0;
    width: 100%;
}

.current-time {
    font-weight: bold;
}

.remaining-time {
    font-weight: bold;
}

/* Back Button */
.back-button {
    margin-top: 15px;
    font-size: 14px;
}

.back-button.selected {
    background-color: #333;
    color: #BDBDBD;
    font-weight: bold;
    border-radius: 3px;
    margin: 2px 5px;
    padding: 6px 20px;
}

.back-button.selected a {
    color: #BDBDBD !important;
}

/* Preview Page Styles */
.preview-content {
    flex: 1;
    width: 90%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 10px 15px;
    overflow-y: auto;
}

.profile-section {
    text-align: center;
    margin-bottom: 15px;
}

.profile-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

.profile-title {
    font-size: 12px;
    margin-bottom: 2px;
}

.profile-location {
    font-size: 11px;
    margin-bottom: 10px;
}

.divider {
    width: 100%;
    height: 1px;
    background-color: #999;
    margin: 10px 0;
}

.info-section {
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    margin-bottom: 10px;
    padding: 2px 5px;
    line-height: 1.3; /* Add proper line spacing for wrapped text */
    align-items: flex-start; /* Align items to top to handle multi-line content */
}

.info-item .label {
    font-weight: normal;
    line-height: 1.3; /* Add proper line spacing for wrapped text */
}

.info-item .value {
    text-align: right;
    max-width: 60%;
    line-height: 1.3; /* Ensure proper line spacing for wrapped text */
}

/* ── Gen 1 iPod outer button ring ────────────────────────────────────────── */
.wheel-container {
    position: relative;
    width: 352px;
    height: 352px;
    margin-top: 40px;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55) 0%, transparent 45%),
        radial-gradient(circle at 68% 70%, rgba(255, 255, 255, 0.15) 0%, transparent 30%),
        linear-gradient(145deg, #F0F0F0 0%, #E0E0E0 100%);
    border-radius: 50%;
    border: none;
    /* Soft shadow edge — no hard border line on the outer ring */
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.18),
        inset 0 -3px 6px rgba(255, 255, 255, 0.7),
        inset 0 8px 18px rgba(255, 255, 255, 0.22),
        0 0 0 1.5px rgba(0, 0, 0, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Divider lines at 45° / 135° / 225° / 315°.
   Two linear-gradients (one per diagonal) produce perfectly uniform-width
   straight lines. The click wheel (z-index: 2) covers the center, leaving
   only the ring-band portion visible. */
.wheel-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        linear-gradient(45deg,
            transparent calc(50% - 0.725px),
            rgba(0,0,0,0.65) calc(50% - 0.725px) calc(50% + 0.725px),
            transparent calc(50% + 0.725px)
        ),
        linear-gradient(135deg,
            transparent calc(50% - 0.725px),
            rgba(0,0,0,0.65) calc(50% - 0.725px) calc(50% + 0.725px),
            transparent calc(50% + 0.725px)
        );
    pointer-events: none;
}

/* Hard black line separating the button ring from the click wheel */
.wheel-container .click-wheel {
    position: relative;
    z-index: 2;
    margin-top: 0;
    border: 1.4px solid rgba(0, 0, 0, 0.65);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.2),
        inset 0 -1.5px 3px rgba(255, 255, 255, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.15);
}

/*
 * Each button fills the whole container (inset: 0) and is clipped to its
 * 90° ring-arc by clip-path: path(). clip-path also restricts pointer events
 * to that arc so the click wheel beneath stays fully interactive.
 *
 * Arc geometry: outer r=176, inner r=142, container 352×352, center (176,176).
 * Separators at 45° / 135° / 225° / 315°  (0° = top, clockwise).
 */
.wheel-btn {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1;
    display: flex;
    padding: 0;
    user-select: none;
    font-family: 'Macintosh Regular', 'Monaco', 'Lucida Console', 'Courier New', monospace;
    color: #999;
    -webkit-font-smoothing: none;
    font-smooth: never;
    letter-spacing: 0.5px;
    line-height: 1;
}

.wheel-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.wheel-btn:active {
    background: rgba(0, 0, 0, 0.1);
    color: #444;
}

/* menu — top arc, 315° → 45° through 0° */
.btn-menu {
    font-size: 14px;
    align-items: flex-start;
    justify-content: center;
    padding-top: 11px;
    clip-path: path('M 75.6 75.6 A 142 142 0 0 1 276.4 75.6 L 300.4 51.6 A 176 176 0 0 0 51.6 51.6 Z');
}

/* prev — left arc, 225° → 315° */
.btn-prev {
    align-items: center;
    justify-content: flex-start;
    padding-left: 8px;
    clip-path: path('M 75.6 276.4 A 142 142 0 0 1 75.6 75.6 L 51.6 51.6 A 176 176 0 0 0 51.6 300.4 Z');
}

/* next — right arc, 45° → 135° */
.btn-next {
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    clip-path: path('M 276.4 75.6 A 142 142 0 0 1 276.4 276.4 L 300.4 300.4 A 176 176 0 0 0 300.4 51.6 Z');
}

/* play/pause — bottom arc, 135° → 225° */
.btn-play {
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    clip-path: path('M 276.4 276.4 A 142 142 0 0 1 75.6 276.4 L 51.6 300.4 A 176 176 0 0 0 300.4 300.4 Z');
}

/* SVG icons — avoids iOS rendering Unicode controls as emoji */
.btn-prev,
.btn-next,
.btn-play {
    font-size: 0;
    color: transparent;
}

.btn-prev::before,
.btn-next::before,
.btn-play::before {
    content: '';
    display: block;
    width: 20px;
    height: 12px;
    background: center / contain no-repeat;
}

.btn-prev::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Crect x='1' y='1' width='2' height='10' fill='%23999'/%3E%3Cpolygon points='9,1 9,11 3,6' fill='%23999'/%3E%3Cpolygon points='15,1 15,11 9,6' fill='%23999'/%3E%3C/svg%3E");
}

.btn-next::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpolygon points='1,1 1,11 7,6' fill='%23999'/%3E%3Cpolygon points='7,1 7,11 13,6' fill='%23999'/%3E%3Crect x='13' y='1' width='2' height='10' fill='%23999'/%3E%3C/svg%3E");
}

.btn-play::before {
    width: 17px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 12'%3E%3Cpolygon points='1,1 1,11 7,6' fill='%23999'/%3E%3Crect x='10' y='1' width='2' height='10' fill='%23999'/%3E%3Crect x='14' y='1' width='2' height='10' fill='%23999'/%3E%3C/svg%3E");
}

.btn-prev:hover::before,
.btn-next:hover::before,
.btn-play:hover::before {
    filter: brightness(0.55);
}

.btn-prev:active::before,
.btn-next:active::before,
.btn-play:active::before {
    filter: brightness(0.4);
}
