:root {
    --primary: #fbbf24;
    /* Amber/Gold */
    --primary-glow: rgba(251, 191, 36, 0.4);
    --emerald-glow: rgba(16, 185, 129, 0.2);
    --emerald-900: #064e3b;
    --emerald-950: #022c22;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Amiri', 'Poppins', sans-serif;
    background: var(--emerald-950);
    color: white;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Crazy Good Mesh Gradient Background */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #022c22;
    background-image:
        radial-gradient(at 0% 0%, hsla(161, 100%, 13%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(158, 100%, 15%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(155, 100%, 10%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(160, 100%, 8%, 1) 0, transparent 50%),
        radial-gradient(at 50% 100%, hsla(158, 100%, 6%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(163, 100%, 12%, 1) 0, transparent 50%);
    background-size: 200% 200%;
    animation: meshMove 15s ease infinite alternate;
    z-index: -1;
}

@keyframes meshMove {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}

.app-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fadeIn 1.2s ease-out;
    display: flex;
    justify-content: center;
}

/* Refined Luxury Player Card */
.player-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    padding: 50px 30px;
    text-align: center;
    box-shadow:
        0 30px 60px -12px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    overflow: hidden;
}

/* Card Shine Effect */
.player-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(234, 179, 8, 0.05) 0%, transparent 60%);
    pointer-events: none;
    animation: rotateShine 10s linear infinite;
}

@keyframes rotateShine {
    to {
        transform: rotate(360deg);
    }
}

.app-header {
    margin-bottom: 5px;
}

.app-logo {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(251, 191, 36, 0.2);
}

/* Premium Visualizer */
.visualizer-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

.visualizer-bars {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    z-index: 2;
}

.visualizer-bars span {
    width: 5px;
    height: 8px;
    background: linear-gradient(to top, var(--primary), #fff);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--primary-glow);
}

.playing .visualizer-bars span {
    animation: bounce 0.8s ease-in-out infinite alternate;
}

.playing .visualizer-bars span:nth-child(2) {
    animation-delay: 0.1s;
}

.playing .visualizer-bars span:nth-child(3) {
    animation-delay: 0.2s;
}

.playing .visualizer-bars span:nth-child(4) {
    animation-delay: 0.3s;
}

.playing .visualizer-bars span:nth-child(5) {
    animation-delay: 0.4s;
}

.glowing-orb {
    position: absolute;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--primary), transparent 70%);
    opacity: 0.15;
    filter: blur(25px);
    border-radius: 50%;
    z-index: 1;
}

.playing .glowing-orb {
    animation: pulseOrb 2s ease-in-out infinite;
}

/* Luxury Typography */
.station-info {
    width: 100%;
}

.station-info h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
    min-height: 2.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #fff 0%, #d1d5db 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.4;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.live-indicator {
    font-size: 14px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 16px;
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.8);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-indicator span {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

.playing .live-indicator span {
    animation: blink 1s infinite;
}

/* Play Button: Luxury Gradient */
.player-controls {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.play-trigger {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    color: var(--emerald-950);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.3),
        0 0 0 10px rgba(255, 255, 255, 0.05);
}

.play-trigger svg {
    width: 40px;
    height: 40px;
    margin-left: -5px;
}

.playing .play-trigger svg {
    margin-left: 0;
}

.play-trigger:active {
    transform: scale(0.95);
}

.playing .play-trigger {
    background: linear-gradient(135deg, var(--primary) 0%, #fb923c 100%);
    color: white;
    box-shadow:
        0 20px 40px rgba(251, 191, 36, 0.4),
        0 0 0 15px rgba(251, 191, 36, 0.1);
    animation: pulseButton 2s infinite;
}

.glass-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 16px 32px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    backdrop-filter: blur(10px);
}

.glass-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: flex-end;
    transition: var(--transition);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-overlay.hidden .modal-content {
    transform: translateY(100%);
}

.modal-content {
    width: 100%;
    background: #022c22;
    border-top: 1px solid var(--glass-border);
    border-radius: 40px 40px 0 0;
    max-height: 85vh;
    padding: 30px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.back-btn.hidden {
    display: none;
}

#close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
}

.search-container input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 15px 20px;
    color: white;
    margin-bottom: 20px;
    font-family: inherit;
    font-size: 16px;
    outline: none;
}

.station-list {
    overflow-y: auto;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    transition: var(--transition);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.category-item {
    background: rgba(251, 191, 36, 0.05);
    border: 1px solid var(--glass-border);
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.category-item:hover {
    background: rgba(251, 191, 36, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.category-item h3 {
    font-size: 16px;
    color: var(--primary);
}

.station-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}


.station-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.station-item .station-icon {
    width: 44px;
    height: 44px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.station-item-info {
    text-align: right;
}

.station-item-info h3 {
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 2px;
}

.station-item-info p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

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

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

@keyframes bounce {
    to {
        height: 100%;
    }
}

@keyframes pulseOrb {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.2;
    }
}

@keyframes pulseButton {
    0% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.6);
    }

    70% {
        box-shadow: 0 0 0 25px rgba(251, 191, 36, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Hide scrollbar */
.station-list::-webkit-scrollbar {
    width: 0;
}