:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --primary-color: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border_box;
    font-family: 'Outfit', sans-serif;
}

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
}

/* Video Background */
#video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    /* Hidden initially until loaded */
    transition: opacity 1.5s ease;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* Darkens video for text readability */
    backdrop-filter: blur(5px);
}

/* Glassmorphism Card */
.glass-container {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 3rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    animation: fadeIn 1s ease-out;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #fff, #a2a2a2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: #ddd;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Input Section */
.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
}

input[type="text"] {
    flex-grow: 1;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.5);
}

button {
    padding: 15px 30px;
    border-radius: 12px;
    border: none;
    background: white;
    color: black;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

button:active {
    transform: scale(0.98);
}

#status-msg {
    min-height: 20px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #aaa;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Audio Controls - Minimal Glass Pill */
/* Audio Controls - Minimal Glass Pill */
/* .audio-controls removed, using new global classes below */
.control-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    width: 100%;
}

.control-wrapper.hidden {
    display: none;
}

/* Circular Play Button */
.circle-btn {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    /* Prevent shrinking */
}

.circle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.circle-btn img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: invert(1);
}

/* Volume Pill Container */
.volume-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 0 20px;
    height: 60px;
    /* Match button height exactly */
    border-radius: 35px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.vol-icon {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    width: 15px;
    text-align: center;
    line-height: 1;
}

/* Custom Range Slider */
input[type=range] {
    -webkit-appearance: none;
    width: 140px;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

/* Slider Track */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.7);
    /* Dark track like image */
    border-radius: 2px;
    border: none;
}

/* Slider Thumb */
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    margin-top: -8px;
    /* Center on track */
    border: none;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Firefox Support */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 2px;
    border: none;
}

input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Video & Overlay adjustments for visibility */
.glass-container {
    /* Ensure overlay doesn't mess with z-index */
    position: relative;
    z-index: 10;
}

/* .mode-toggle removed */

.music-container {
    margin-top: 15px;
    width: 100%;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.music-container.hidden {
    display: none;
}

/* Header adjustments */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    position: relative;
    width: 100%;
    /* max-width constrained by parent */
}

.icon-text-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    font-size: 0.9rem;
    color: white;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: background 0.3s;
}

.icon-text-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Layout Wrapper */
.app-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100vw;
    perspective: 1000px;
}

.menu-card {
    position: relative;
    padding: 3rem;
    width: 400px;
    width: 0;
    padding: 0;
    opacity: 0;
    transform: translateX(50px) scale(0.9);
    filter: blur(10px);
    overflow: hidden;
    margin-left: -20px;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 0;
    pointer-events: none;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Active State for Menu */
.menu-card.active {
    width: 400px;
    padding: 2rem;
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
    margin-left: 0;
    border: 1px solid var(--glass-border);
    pointer-events: auto;
}

.menu-card h2 {
    white-space: nowrap;
    margin-bottom: 20px;
}

#fav-list {
    overflow-y: auto;
    flex-grow: 1;
    width: 100%;
    margin-top: 10px;
}

#fav-list::-webkit-scrollbar {
    width: 5px;
}

#fav-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.fav-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.fav-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.fav-play-icon {
    font-size: 1.2rem;
    color: #ffd700;
}

.fav-text {
    font-size: 0.9rem;
    color: #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Like Button */
#like-btn {
    padding: 15px;
    min-width: 50px;
    font-size: 1.5rem;
    line-height: 1;
    color: #ccc;
    background: rgba(255, 255, 255, 0.1);
}

#like-btn.liked {
    color: #ff4757;
    animation: pulse 0.3s ease;
}

#like-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.empty-msg {
    color: #aaa;
    font-style: italic;
    margin-top: 20px;
}

#main-content {
    transition: transform 0.5s ease;
}

.close-icon {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s ease;
}

.close-icon:hover {
    transform: scale(1.1);
}

#timer-display {
    font-size: 4rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin: 0;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.timer-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 30px;
    min-width: 60px;
}

/* Timer Wrapper & buttons */
.timer-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.adjust-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 1.8rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.adjust-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.adjust-btn:active {
    transform: scale(0.95);
}

.timer-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ddd;
}

.text-btn {
    background: none;
    border: none;
    color: #aaa;
    text-decoration: underline;
    font-size: 0.9rem;
    padding: 10px;
    box-shadow: none;
}

.text-btn:hover {
    color: white;
    transform: none;
    box-shadow: none;
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        padding: 20px 0;
    }

    .app-container {
        flex-direction: column;
        width: 100%;
        height: auto;
        align-items: center;
        gap: 30px;
    }

    .glass-container {
        width: 90%;
        max-width: 100%;
        margin-bottom: 20px;
        min-width: unset;
    }

    .menu-card,
    .menu-card.active {
        position: relative;
        width: 90% !important;
        margin-left: 0;
        transform: none !important;
        max-height: none;
        opacity: 1 !important;
        min-height: auto;
        display: none;
    }

    .menu-card.active {
        display: flex;
        animation: fadeIn 0.5s ease;
    }

    input[type='text'],
    button {
        font-size: 16px;
    }

    #main-content {
        margin-bottom: 20px;
    }
}