:root {
    --bg-gradient-top: #f5f5f7;
    --bg-gradient-bottom: #e5e5ea;
    --text-color: #1d1d1f;
    --ipod-body: #ffffff;
    --ipod-wheel: #e5e5ea;
    --ipod-wheel-center: #ffffff;
    --ipod-screen-bg: #dceef4; /* Classic iPod backlight blue/gray */
    --ipod-text: #000000;
    --ipod-highlight: #3b82f6;
    --font-ipod: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes ipodColors {
    0% { background-color: #f7b2c5; } /* Pastel Pink */
    20% { background-color: #aed581; } /* Pastel Green */
    40% { background-color: #81d4fa; } /* Pastel Blue */
    60% { background-color: #fff59d; } /* Pastel Yellow */
    80% { background-color: #ffcc80; } /* Pastel Orange */
    100% { background-color: #f7b2c5; } /* Pastel Pink */
}

body {
    background-color: #f7b2c5;
    animation: ipodColors 25s infinite;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    position: fixed;
    color: var(--text-color);
    font-family: var(--font-ipod);
    -webkit-font-smoothing: antialiased;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navbar */
.navbar {
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1000px;
    align-items: center;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: #86868b;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-color);
}

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #86868b;
    margin-bottom: 4rem;
}

/* The iPod Device */
.ipod-device {
    background: var(--ipod-body);
    width: 480px;
    height: 800px;
    border-radius: 35px;
    box-shadow: 
        inset -2px -2px 10px rgba(0,0,0,0.1),
        inset 2px 2px 10px rgba(255,255,255,1),
        0 30px 60px rgba(0,0,0,0.2),
        0 0 0 1px #d1d1d6;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin: 0 auto;
}

.ipod-device::after {
    /* Silver back reflection edge */
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    border-radius: 37px;
    z-index: -1;
    background: linear-gradient(135deg, #e2e2e2 0%, #ffffff 50%, #d1d1d6 100%);
}

/* Screen */
.ipod-screen-container {
    width: 100%;
    height: 320px;
    background: #000;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 50px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.ipod-screen {
    width: 100%;
    height: 100%;
    background: var(--ipod-screen-bg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ipod-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), rgba(255,255,255,0.2));
}

.ipod-view {
    flex: 1;
    display: flex;
    width: 100%;
    height: 100%;
}

.ipod-view.hidden {
    display: none;
}

/* Split Menu View */
.ipod-menu-left {
    width: 50%;
    border-right: 1px solid rgba(0,0,0,0.2);
    background: #fff;
    display: flex;
    flex-direction: column;
}

.ipod-menu-right {
    width: 50%;
    background: var(--ipod-screen-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ipod-menu-title {
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    background: linear-gradient(to bottom, #fff, #e0e0e0);
}

.ipod-menu-list {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.ipod-menu-item {
    padding: 4px 8px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    cursor: default;
}

.ipod-menu-item.active {
    background: var(--ipod-highlight);
    color: #fff;
}

.ipod-cover-art {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: 1px solid rgba(0,0,0,0.1);
}

/* Form View */
#ipod-form-view {
    flex-direction: column;
    background: #fff;
}

.ipod-form {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

.ipod-input {
    width: 100%;
    border: 1px solid #ccc;
    padding: 6px 8px;
    font-family: var(--font-ipod);
    font-size: 12px;
    border-radius: 4px;
}

.ipod-input:focus {
    outline: none;
    border-color: var(--ipod-highlight);
}

.ipod-submit-btn {
    background: linear-gradient(to bottom, #fff, #e0e0e0);
    border: 1px solid #999;
    padding: 6px;
    font-family: var(--font-ipod);
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.ipod-submit-btn:active {
    background: #d0d0d0;
}

/* Now Playing (Success) View */
#ipod-success-view {
    flex-direction: column;
    background: #fff;
    align-items: center;
    padding-top: 10px;
}

.now-playing-art {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.now-playing-info {
    text-align: center;
    width: 100%;
}

.np-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.np-artist {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.np-progress {
    width: 90%;
    height: 10px;
    background: linear-gradient(to bottom, #ccc, #eee);
    border: 1px solid #999;
    border-radius: 5px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.np-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to bottom, #7fb9ff, #3b82f6);
    animation: ipodPlay 2s linear forwards;
}

@keyframes ipodPlay {
    to { width: 100%; }
}

/* Click Wheel */
.ipod-click-wheel, .ipod-click-wheel * {
    touch-action: none; /* Prevents the page from panning/scrolling when using the wheel on mobile */
}

.ipod-click-wheel {
    width: 320px;
    height: 320px;
    background: var(--ipod-wheel);
    border-radius: 50%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        inset 0 2px 5px rgba(0,0,0,0.1),
        0 1px 1px rgba(255,255,255,1);
    cursor: pointer;
}

.wheel-center-btn {
    width: 110px;
    height: 110px;
    background: var(--ipod-wheel-center);
    border-radius: 50%;
    box-shadow: 
        inset 0 1px 3px rgba(255,255,255,1),
        0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.1s, box-shadow 0.1s;
    z-index: 10;
}

.wheel-center-btn:active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
}

.wheel-btn {
    position: absolute;
    font-weight: bold;
    font-size: 12px;
    color: #86868b;
    pointer-events: none; /* Let the wheel take the clicks except for visual */
}

.wheel-top { top: 15px; }
.wheel-bottom { bottom: 15px; }
.wheel-left { left: 15px; }
.wheel-right { right: 15px; }

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    .nav-links {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        width: 100%;
        padding-bottom: 0.5rem;
    }
    .nav-links a {
        flex-shrink: 0;
    }
}

@media (max-width: 540px) {
    .ipod-device {
        transform: scale(0.85);
    }
}

@media (max-width: 440px) {
    .ipod-device {
        transform: scale(0.75);
    }
    .hero {
        padding: 0;
    }
}

@media (max-width: 380px) {
    .ipod-device {
        transform: scale(0.65);
    }
}
