@font-face {
    font-family: 'Chicago';
    src: url('/public/assets/fonts/ChicagoFLF.ttf') format('truetype');
}

:root {
    --colour-iPod-case: #f0f0f0;
    --colour-iPod-case-shadow: #7e7e7e;

    --colour-iPod-click-wheel: #bebebe;

    --colour-iPod-iPodCase1: #c8c8c8;
    --colour-iPod-iPodCase2: #f0f0f0;

    --colour-iPod-clickWheelStroke: #a5a5a5;
    --colour-iPod-clickWheelFill: #bebebe;
    --colour-iPod-buttonActive: #8c8c8c;
    --colour-iPod-buttonInactive: #fafafa;

    --colour-iPod-screen-background: #c6c3bc;
    --colour-iPod-screen-text-normal: #34312c;
    --colour-iPod-screen-text-light: #767776;
    --colour-iPod-screen-border: #323232;

    --colour-iPod-screen-background-backlight: #98c8ff;
    --colour-iPod-screen-text-normal-backlight: #576db7;
    --colour-iPod-screen-text-light-backlight: #74a2db;
    --colour-iPod-screen-border-backlight: #505050;
}

.ipod-container {
    position: fixed;
    font-family: 'Chicago';
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 680px;
    background: var(--colour-iPod-case);
    border-radius: 20px;
    box-shadow: inset 0 0px 30px var(--colour-iPod-case-shadow);
    padding: 30px;
    display: flex;
    flex-direction: column;
    /* Scale transform will be handled by JavaScript */
    /* Make sure UI stays sharp */
    transform: translate(-50%, -50%) translateZ(0);
    -webkit-transform: translate(-50%, -50%) translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Screen Styles */
.ipod-screen {
    background: #c6c3bc; /* Default/off state background color */
    border: 3px solid #323232;
    border-radius: 8px;
    font-family: 'Chicago', monospace;
    color: #34312c; /* Default/off state text color */
    height: 240px;
    display: flex;
    flex-direction: column;
    margin: 30px;
    padding: 10px;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease; /* Smooth transition for color changes */
}

.ipod-screen.backlight-on {
    background: #98c8ff; /* Backlight on background color */
    color: #576db7; /* Backlight on text color */
    border-color: #505050;
}

.screen-time {
    font-size: 20px;
    text-align: center;
    padding: 0;
    border-bottom: 2px solid currentColor;
    margin-bottom: 10px;
}

/* TRACK INFO */

.track-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    font-size: 20px;
    gap: 10px;
}

/** Progress Bar */

.progress-container {
    padding: 10px 20px;
}

.progress-time {
    display: flex;
    justify-content: space-between;
    font-size: 20px;
    padding: 0px 5px;
}

.progress-bar {
    background: var(--colour-iPod-screen-text-light);
    border-radius: 20px;
    height: 10px;
    margin: 10px 0;
    overflow: hidden; /* Ensure progress fill stays within bounds */
    position: relative; /* For absolute positioning of fill */
}

.backlight-on .progress-bar {
    background: var(--colour-iPod-screen-text-light-backlight);
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%; /* Will be updated by JavaScript */
    background: var(--colour-iPod-screen-text-normal);
    transition: width 0.1s linear; /* Smooth progress updates */
}

.backlight-on .progress-fill {
    background: var(--colour-iPod-screen-text-normal-backlight);
}

.noise-status {
    text-align: center;
    font-size: 12px;
    margin-bottom: 10px;
}

.backlight-on .noise-status.active {
    background: #576db7;
    color: #98c8ff;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Click Wheel */
.click-wheel {
    position: relative;
    width: 320px;
    height: 320px;
    margin: auto;
    background: var(--colour-iPod-click-wheel);
    border-radius: 50%;
}

/* Center button */
.wheel-button.center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    background-color: var(--colour-iPod-case);
}

/* Control buttons */
.material-icons {
    font-size: 80px;
}

.iPod-button {
    background-color: var(--colour-click-wheel);
    color: var(--colour-iPod-case);
}

.iPod-button:hover {
    color: white;
}

.wheel-button {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.wheel-button.noise-cancel {
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.wheel-button.previous {
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.wheel-button.next {
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

.wheel-button.play-pause {
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
}

/* Ensure proper touch target sizes */
.control-button,
.iPod-button,
.wheel-button {
    min-width: 44px; /* Minimum touch target size */
    min-height: 44px;
    touch-action: manipulation; /* Disable browser touch actions */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
}
/*
/* Additional adjustments for very narrow screens */
@media (max-width: 360px) {
    .ipod-container {
        padding: 15px;
    }

    .click-wheel {
        width: 240px;
        height: 240px;
    }
}

/* Adjustments for landscape orientation */
@media (max-height: 500px) {
    .ipod-container {
        top: 45%; /* Move slightly higher in landscape */
    }
}
