:root {
    --primary-color: #ff6b00;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #c1cdef;
    --secondary-text-color: #b3b3b3;
    --spacing-unit: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at center, #1e1e1e 0%, #0a0a0a 100%);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center vertically on desktop */
    overflow: auto;
}

.app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-unit);
    background-color: var(--surface-color);
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

header {
    display: flex;
    justify-content: center;
    padding: var(--spacing-unit) 0 0 0;
    /* Zero bottom padding */
    position: relative;
}

#install-btn {
    margin-top: 0;
    margin-bottom: 5px;
    align-self: center;
    /* Center in column flex container */
    z-index: 5;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.subtitle {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 1px;
    opacity: 0.9;
}

.header-img {
    height: 90px;
    /* Adjust height as needed */
    max-width: 100%;
    object-fit: contain;
    /* Clean white look */
    filter: invert(1) brightness(2);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Push items to top */
    align-items: center;
    gap: 0.8rem;
    padding-top: 10px;
}

.vu-outer {
    width: 340px;
    height: 55px;
    background: #000;
    border-radius: 16px;
    border: 1px solid #333;
    padding: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(255, 107, 0, 0.1);
    margin-bottom: 0.5rem;
    /* Reduced margin to give space to text */
}

/* ... existing code ... */

.track-info {
    text-align: center;
    margin: 0;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Align text to bottom so it grows upwards */
    width: 100%;
}

h1 {
    font-size: 1.4rem;
    color: #c1cdef;
    text-transform: normal;
    letter-spacing: 2px;
    margin-bottom: 0.2rem;
    text-shadow: 0 0 20px rgba(193, 205, 239, 0.4);
    font-weight: 700;

    /* Allow wrapping */
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    padding: 0 10px;
}

p {
    color: var(--primary-color);
    font-size: 1rem;
    font-style: italic;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(255, 107, 0, 0.3);

    /* Allow wrapping */
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.2;
    padding: 0 10px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    color: #c1cdef;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 107, 0, 0.3);
}

.play-btn svg {
    width: 40px;
    height: 40px;
    fill: currentColor;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(193, 205, 239, 0.3);
    border-radius: 50%;
    border-top-color: #c1cdef;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.volume-container {
    width: 80%;
    max-width: 300px;
    display: flex;
    align-items: center;
}

#volume-slider {
    width: 100%;
    appearance: none;
    height: 4px;
    background: #444;
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}


.action-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    width: 90% !important;
    max-width: 300px !important;
    margin: 20px auto !important;
    padding-bottom: 30px !important;
}

.action-btn {
    background: linear-gradient(145deg, #333333, #1a1a1a);
    border: 1px solid rgba(193, 205, 239, 0.1) !important;
    color: var(--text-color);
    padding: 14px 10px;
    border-radius: 50px !important;
    /* Force pill shape */
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
}

.action-btn:active {
    transform: scale(0.95);
    background: linear-gradient(145deg, #1a1a1a, #333333);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    border-color: var(--primary-color);
}

.action-btn.primary {
    background: linear-gradient(145deg, var(--primary-color), #cc5500) !important;
    color: #c1cdef !important;
    border: none !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.action-btn.primary:active {
    background: linear-gradient(145deg, #cc5500, var(--primary-color)) !important;
}

footer {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    border-top: 1px solid rgba(193, 205, 239, 0.05);
}

.copyright {
    color: #00bfff;
    /* Deep Sky Blue */
    font-size: 0.7rem;
    font-family: monospace;
    text-align: center;
    text-shadow: 0 0 5px #00bfff, 0 0 10px #00bfff;
    /* Blue glow */
    opacity: 0.8;
}

#install-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
}

/* --- Debug Log Layout --- */
#debug-log-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 20px;
    font-family: monospace;
    color: #0f0;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.debug-actions {
    display: flex;
    gap: 10px;
}

.debug-actions button {
    background: #333;
    color: white;
    border: 1px solid #555;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

#debug-log-content {
    flex: 1;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
}

.log-entry {
    margin-bottom: 4px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 2px;
}

.log-error {
    color: #f55;
}

.log-warn {
    color: #ff0;
}

/* --- Premium Desktop Enhancements --- */
@media (min-width: 500px) {
    body {
        background:
            linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
            url('desktop_bg.jpg') no-repeat center center fixed;
        background-size: cover;
    }

    .app-container {
        border-radius: 40px;
        margin: 40px 0;
        height: 850px;
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow:
            0 30px 60px -12px rgba(0, 0, 0, 0.9),
            0 0 80px rgba(255, 107, 0, 0.25);
        backdrop-filter: blur(20px);
    }
}

/* --- Request Form Overlay --- */
#request-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    /* Controlled by JS flex */
    justify-content: center;
    align-items: flex-end;
    /* Mobile: bottom sheet */
    transition: opacity 0.3s ease;
}

.request-form-content {
    width: 100%;
    max-width: 480px;
    background: var(--surface-color);
    border-radius: 30px 30px 0 0;
    padding: 25px 25px 40px 25px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#request-form-overlay.active .request-form-content {
    transform: translateY(0);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.form-header h2 {
    font-size: 1.1rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.form-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 0.75rem;
    color: var(--secondary-text-color);
    font-weight: 700;
    text-transform: uppercase;
    padding-left: 5px;
}

.input-group input,
.input-group textarea {
    background: #121212;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(255, 107, 0, 0.2);
}

.submit-btn {
    background: linear-gradient(135deg, #ff8c00, #ff6b00);
    color: #fff;
    border: none;
    border-radius: 18px;
    padding: 18px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 107, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.submit-btn:active {
    transform: scale(0.97);
}

@media (min-width: 500px) {
    #request-form-overlay {
        align-items: center;
        /* Desktop: centered modal */
    }

    .request-form-content {
        border-radius: 30px;
        width: 90%;
        max-width: 440px;
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    #request-form-overlay.active .request-form-content {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Cookie Banner - Centered Modal Redesign */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}

.cookie-content {
    background: linear-gradient(145deg, #1e1e1e, #252525);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #444;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cookie-content h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.cookie-content p {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

.cookie-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.cookie-buttons button {
    flex: 1;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    border: none;
}

#cookie-accept {
    background: var(--primary-color);
    color: #000;
}

#cookie-decline {
    background: transparent;
    border: 1px solid #666;
    color: #ccc;
}

#cookie-accept:hover {
    transform: scale(1.05);
    background: #ffaa33;
}

#cookie-decline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #999;
}