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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

:root {
    --button-face: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.12) 100%);
    --button-face-strong: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.16) 100%);
    --button-border: rgba(255, 255, 255, 0.26);
    --button-highlight: rgba(255, 255, 255, 0.42);
    --button-shadow: rgba(20, 10, 26, 0.2);
    --button-shadow-strong: rgba(20, 10, 26, 0.28);
    --button-icon: rgba(255, 255, 255, 0.94);
    --button-icon-muted: rgba(255, 255, 255, 0.76);
    --button-ring: rgba(255, 255, 255, 0.28);
    --text-primary: #fff8f1;
    --text-secondary: rgba(255, 245, 234, 0.86);
    --text-accent: #f0d5b1;
    --surface-glow: rgba(28, 16, 18, 0.34);
    --surface-glow-strong: rgba(17, 10, 12, 0.52);
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.background-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 70%, rgba(36, 20, 15, 0.42) 0%, rgba(36, 20, 15, 0.12) 28%, transparent 52%),
        radial-gradient(circle at 50% 18%, rgba(255, 247, 237, 0.08) 0%, transparent 28%),
        linear-gradient(180deg, rgba(26, 19, 19, 0.38) 0%, rgba(31, 20, 17, 0.48) 52%, rgba(18, 12, 13, 0.68) 100%);
    pointer-events: none;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.68) saturate(0.84) contrast(1.04) sepia(0.08);
    transform: scale(1.02);
}

/* Player Container */
.player-container {
    position: fixed;
    top: 69%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    isolation: isolate;
}

.player-container::before {
    display: none;
}

.folder-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.folder-selector h2 {
    color: #381400;
    font-size: 2em;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.folder-selector p {
    color: #381400;
    font-size: 1.2em;
    margin-bottom: 30px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.select-folder-btn {
    padding: 15px 40px;
    font-size: 1.02em;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.96);
    background: var(--button-face-strong);
    border: 1px solid var(--button-border);
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    box-shadow:
        inset 0 1px 0 var(--button-highlight),
        inset 0 -10px 18px rgba(255, 255, 255, 0.08),
        0 18px 40px rgba(33, 18, 49, 0.18);
    text-transform: uppercase;
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.select-folder-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -10px 18px rgba(255, 255, 255, 0.1),
        0 22px 44px rgba(33, 18, 49, 0.22);
}

.select-folder-btn:active {
    transform: translateY(0) scale(0.99);
}

.now-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: auto;
    margin-bottom: 18px;
}

.track-info {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    width: fit-content;
    max-width: min(94vw, 1280px);
    min-height: 86px;
    padding: 16px 22px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.22), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05)),
        linear-gradient(180deg, rgba(46, 30, 30, 0.42), rgba(21, 13, 17, 0.34));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -18px 26px rgba(255, 255, 255, 0.04),
        0 24px 60px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(36px) saturate(140%);
    -webkit-backdrop-filter: blur(36px) saturate(140%);
    position: relative;
    overflow: hidden;
}

.track-info::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 42%),
        radial-gradient(circle at 24% 0%, rgba(255, 255, 255, 0.18), transparent 28%);
    opacity: 0.78;
    filter: blur(12px);
    pointer-events: none;
}

.track-info::after {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    top: 10%;
    height: 34%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.02));
    opacity: 0.56;
    filter: blur(16px);
    pointer-events: none;
}

.track-name-viewport {
    overflow: hidden;
    max-width: min(80vw, 1040px);
    min-width: min(28vw, 220px);
    position: relative;
    z-index: 1;
}

.track-name-marquee {
    display: inline-flex;
    align-items: center;
    gap: 40px;
    white-space: nowrap;
    will-change: transform;
}

.track-name-marquee.is-scrolling {
    animation: trackMarquee var(--marquee-duration, 14s) linear infinite;
}

.track-name {
    color: var(--text-primary);
    display: inline-block;
    font-size: 2.05em;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
}

.artist-name {
    color: var(--text-accent);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 1.08em;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-shadow: none;
    background: linear-gradient(180deg, rgba(255, 240, 220, 0.12), rgba(255, 240, 220, 0.04));
    border: 1px solid rgba(255, 230, 198, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -10px 16px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px) saturate(135%);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    position: relative;
    z-index: 1;
}

.artist-name.is-empty {
    display: none;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 26px;
    margin-top: 18px;
}

.control-btn {
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid var(--button-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.28s ease,
        box-shadow 0.28s ease,
        border-color 0.28s ease,
        background 0.28s ease;
    background: var(--button-face);
    backdrop-filter: blur(24px) saturate(165%);
    -webkit-backdrop-filter: blur(24px) saturate(165%);
    box-shadow:
        inset 0 1px 0 var(--button-highlight),
        inset 0 -10px 20px rgba(255, 255, 255, 0.08),
        0 18px 32px var(--button-shadow);
}

.control-btn::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background:
        radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.46), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 50%);
    opacity: 0.74;
    filter: blur(10px);
    pointer-events: none;
}

.control-btn::after {
    content: '';
    position: absolute;
    left: 18%;
    right: 18%;
    top: 10%;
    height: 34%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.02));
    opacity: 0.52;
    filter: blur(14px);
    pointer-events: none;
}

.control-btn:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.54),
        inset 0 -12px 22px rgba(255, 255, 255, 0.1),
        0 22px 40px var(--button-shadow-strong);
}

.control-btn:active {
    transform: translateY(0) scale(0.98);
}

.control-btn:focus-visible,
.panel-btn:focus-visible,
.select-folder-btn:focus-visible,
.close-panel-btn:focus-visible {
    outline: none;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.52),
        0 0 0 3px var(--button-ring),
        0 18px 32px var(--button-shadow-strong);
}

.play-btn {
    width: 108px;
    height: 108px;
    background: var(--button-face-strong);
}

.play-btn:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.18) 100%);
}

.play-btn svg {
    position: relative;
    z-index: 1;
    width: 54px;
    height: 54px;
    color: var(--button-icon);
    filter: drop-shadow(0 6px 16px rgba(26, 13, 35, 0.2));
}

.play-icon {
    margin-left: 3px;
}

.nav-btn {
    width: 72px;
    height: 72px;
}

.nav-btn:hover svg,
.play-btn:hover svg {
    color: #fff9ef;
}

.nav-btn svg {
    position: relative;
    z-index: 1;
    width: 34px;
    height: 34px;
    color: var(--button-icon);
    filter: drop-shadow(0 5px 14px rgba(26, 13, 35, 0.18));
}

@keyframes trackMarquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(calc(-1 * var(--marquee-distance, 280px)));
    }
}

/* Audio Level Control */
.audio-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(22, 16, 20, 0.5);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: none; /* Başlangıçta gizli */
}

.audio-control-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-label {
    color: var(--text-accent);
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
}

#broadcastLevel {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

#broadcastLevel::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#broadcastLevel::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

#levelValue {
    color: #fff;
    font-size: 0.9em;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
}

/* Bottom Text */
.bottom-text-container {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
    width: 100%;
    max-width: 90%;
}

.bottom-text {
    color: var(--text-primary);
    font-size: 1.8em;
    font-weight: 600;
    letter-spacing: 2px;
    text-shadow: 0 12px 34px rgba(0, 0, 0, 0.44);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 0 8px 0;
    user-select: none;
}

.bottom-text:hover {
    transform: scale(1.05);
    text-shadow: 0 14px 40px rgba(0, 0, 0, 0.46);
}

.bottom-subtitle {
    color: var(--text-secondary);
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: 1px;
    text-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    user-select: none;
    opacity: 0.85;
}

.bottom-text-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(70vw, 520px);
    height: 120px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(22, 14, 18, 0.32), rgba(22, 14, 18, 0.12));
    filter: blur(18px);
    z-index: -1;
}

.bottom-subtitle:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* Edit Panel */
.edit-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-panel-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(40px);
    border-radius: 20px;
    padding: 40px;
    min-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    position: relative;
}

.edit-panel-content h3 {
    color: #fff;
    font-size: 1.5em;
    margin-bottom: 30px;
    text-align: center;
}

.close-panel-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--button-face);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.6em;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 12px 24px rgba(20, 10, 26, 0.16);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.close-panel-btn:hover {
    transform: translateY(-2px) rotate(90deg);
    border-color: rgba(255, 255, 255, 0.34);
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    color: #fff;
    font-size: 1em;
    font-weight: 500;
}

.form-group input[type="text"] {
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1em;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus {
    border-color: #d4af37;
    background: rgba(255, 255, 255, 0.15);
}

.form-group input[type="color"] {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.font-size-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.font-size-control input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    cursor: pointer;
}

.font-size-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.font-size-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.font-size-control span {
    color: #d4af37;
    font-size: 1.1em;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.edit-panel-buttons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.panel-btn {
    flex: 1;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 0.98em;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease, background 0.28s ease;
    text-transform: uppercase;
}

.save-btn {
    background: var(--button-face-strong);
    color: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -10px 20px rgba(255, 255, 255, 0.08),
        0 16px 30px rgba(20, 10, 26, 0.18);
    backdrop-filter: blur(20px) saturate(155%);
    -webkit-backdrop-filter: blur(20px) saturate(155%);
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.46),
        inset 0 -10px 20px rgba(255, 255, 255, 0.1),
        0 20px 36px rgba(20, 10, 26, 0.22);
}

.cancel-btn {
    background: var(--button-face);
    color: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        inset 0 -10px 18px rgba(255, 255, 255, 0.06),
        0 12px 24px rgba(20, 10, 26, 0.14);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.cancel-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -10px 18px rgba(255, 255, 255, 0.08),
        0 18px 32px rgba(20, 10, 26, 0.18);
}

/* Responsive Design */
@media (max-width: 768px) {
    .player-container {
        max-width: 90%;
    }
    
    .track-name {
        font-size: 1.45em;
    }
    
    .artist-name {
        min-width: 60px;
        min-height: 40px;
        padding: 0 14px;
        font-size: 0.9em;
    }

    .track-info {
        max-width: min(94vw, 760px);
        min-height: 74px;
        padding: 14px 16px;
        gap: 12px;
    }

    .track-name-viewport {
        max-width: min(74vw, 620px);
        min-width: min(34vw, 180px);
    }
    
    .play-btn {
        width: 92px;
        height: 92px;
    }
    
    .play-btn svg {
        width: 42px;
        height: 42px;
    }
    
    .nav-btn {
        width: 58px;
        height: 58px;
    }
    
    .nav-btn svg {
        width: 28px;
        height: 28px;
    }
    
    .controls {
        gap: 20px;
    }
    
    .audio-control {
        top: 10px;
        right: 10px;
        padding: 10px 15px;
    }
    
    .audio-control-content {
        gap: 8px;
    }
    
    .audio-label {
        font-size: 0.8em;
    }
    
    #broadcastLevel {
        width: 80px;
    }
    
    #levelValue {
        font-size: 0.8em;
        min-width: 40px;
    }
    
    .bottom-text-container {
        bottom: 30px;
    }
    
    .bottom-text {
        font-size: 1.4em;
    }
    
    .edit-panel-content {
        min-width: 90%;
        padding: 30px 20px;
    }
}

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.track-name.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Smooth transitions */
.track-name,
.artist-name {
    transition: opacity 0.3s ease;
}
