/* General Reset and Layout */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Parkinson', sans-serif;
    background-color: #121212;
    color: white;
    height: 100%;
    overflow: hidden;
}

/* Page Loader Styles */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px; /* Height of the loading bar */
    background-color: #121212; /* Background color */
    z-index: 1000;
}

/* Progress Bar Container */
.progress-bar-container {
    width: 100%;
    height: 100%;
    background-color: #333; /* Dark background for the loading bar */
}

/* Animated Progress Bar */
.progress-bar {
    width: 0;
    height: 100%;
    background-color: #3498db; /* Color of the progress bar */
    animation: fill-bar 10s linear infinite;
}

/* Keyframe for the animated filling */
@keyframes fill-bar {
    0% {
        width: 0%;
    }
    50% {
        width: 50%;
    }
    100% {
        width: 100%;
    }
}

/* Hide loader when page is loaded */
.hide-loader {
    display: none;
}

/* Main Layout */
.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
#header {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #1F1F1F;
    justify-content: space-between;
}

/* Logo Container */
#logo-container {
    display: flex;
    align-items: center;
}

/* Page Logo */
#page-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

#logo-text {
    font-family: 'Anek Telugu', sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: white;
}

/* Search Bar */
#search-container {
    display: flex;
    align-items: center;
    background-color: #333;
    border-radius: 20px;
    padding: 5px 8px;
    width: 200px;
    gap: 10px;
    transition: all 0.3s ease;
}

#search-bar {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    outline: none;
    padding: 0 8px 0 10px;
    width: 100%;
    height: 100%;
}

#search-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 100%;
    width: 40px;
}

/* Main Player */
#player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    flex: 1;
    overflow-y: auto;
}

/* Album Image */
#album-poster {
    width: 350px;
    height: 350px;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    margin-bottom: 15px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Lyrics Section */
#lyrics-container {
    font-family: 'Anek Telugu', sans-serif;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 98%;
    text-align: center;
    color: #e6e3e3;
    font-size: 14px;
    z-index: 10;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    backdrop-filter: blur(8px);
    overflow-y: auto;
    max-height: 98%;
    scroll-behavior: smooth;
}

#lyrics-text {
    white-space: pre-line;
    font-size: 14px;
    color: white;
    line-height: 1.5;
}

/* Highlighted Lyrics */
.highlight {
    color: #ffffff;
    font-weight: none;
}

#lyrics-container::-webkit-scrollbar {
    display: none;
}

/* Song Info */
#song-info {
    text-align: center;
    margin-bottom: 10px;
}

#song-name {
    font-size: 22px;
    font-weight: bold;
    margin: 5px 0;
    color: #ffee00;
}

#song-artist {
    font-size: 12px;
    color: #ffffff;
}

#album-name {
    font-size: 16px;
    font-weight: bold;
    color: #ff0073;
    margin-top: 5px;
}

/* Song List */
#song-list {
    width: 100%;
    padding: 10px;
    background-color: #1F1F1F;
    border-radius: 10px;
    margin-bottom: 20px;
    border: none;
    color: white;
}

/* Controls */
#controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 20px;
}

#controls button {
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

.refresh-button {
    font-size: 24px;
    color: red;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 2px;
}

/* Container for progress bar and time display */
.progress-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Progress Bar */
#progress-bar {
    width: 100%;
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    margin-right: 10px;
    outline: none;
    cursor: pointer;
}

#progress-bar::-webkit-slider-thumb {
    background: #FF4081;
    border: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
}

/* Time Display */
#time-display {
    font-size: 14px;
    color: #FFF;
}

/* Quality Dropdown */
#quality-select {
    background-color: #1F1F1F;
    color: white;
    border: none;
    padding: 8px;
    border-radius: 5px;
    font-size: 16px;
    margin-top: 15px;
}

/* Shuffle and Download Icon */
#shuffle-btn {
    font-size: 30px;
    color: white;
    cursor: pointer;
    margin-right: 20px;
}

#downloadButton {
    font-size: 30px;
    color: white;
    cursor: pointer;
}

#controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#song-list, #quality-select {
    margin: 0 10px;
}

/* Footer Styling */
.footer {
    text-align: center;
    padding: 10px 0;
    background: transparent;
    color: white;
    font-size: 14px;
}

.footer a {
    color: #FF4081;
}

.footer a:hover {
    color: #FF4081;
}

#radio-switch {
    position: absolute;
    right: 250px;
    top: 18px;
}

.radio-button {
    text-decoration: none;
    color: inherit;
    font-size: 24px;
}

.radio-button:hover {
    color: #ff5722;
}

/* Error Popup Styling */
#error-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ff9d00;
    color: white;
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    z-index: 1000;
    opacity: 0;
    animation: popup-animation 0.5s ease-in-out forwards, ribbon-border 3s linear infinite;
}

@keyframes popup-animation {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes ribbon-border {
    0%, 100% {
        border: 5px solid transparent;
        border-image: linear-gradient(45deg, #ff5722, #2196f3);
        border-image-slice: 1;
    }
    50% {
        border: 5px solid transparent;
        border-image: linear-gradient(45deg, #2196f3, #ff5722);
        border-image-slice: 1;
    }
}

/* Button to Switch to Radio */
.btn-radio {
    background-color: #4caf50;
    color: #FF5733;
    border: none;
    padding: 8px 16px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 5px;
}

.btn-radio:hover {
    background-color: #45a049;
}

/* Styling the popup content */
.popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Error Message Text */
#error-message {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
}

@keyframes flipUp {
    0% {
        transform: rotateX(0);
    }
    100% {
        transform: rotateX(-180deg);
    }
}

@keyframes flipDown {
    0% {
        transform: rotateX(0);
    }
    100% {
        transform: rotateX(180deg);
    }
}

#album-poster {
    transform-origin: center;
    perspective: 1000px;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    #loader::before {
        content: "";
        border: 4px solid #f3f3f3;
        border-top: 4px solid #3498db;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        animation: spin 15s linear infinite;
    }

    html, body {
        height: 100%;
        overflow: hidden;
    }

    #search-container {
        display: flex;
        width: 150px;
        height: 25px;
    }

    #search-bar {
        background: none;
        border: none;
        color: white;
        font-size: 14px;
        outline: none;
        padding: 0 6px 0 8px;
        width: 100%;
    }

    #search-btn {
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        width: 40px;
    }

    #radio-switch {
        position: absolute;
        right: 200px;
        top: 18px;
    }

    #song-list {
        width: 90%;
    }

    #song-name {
        font-size: 18px;
    }

    #song-artist {
        font-size: 14px;
    }

    #controls button {
        font-size: 30px;
    }

    #quality-select {
        font-size: 14px;
    }

    #album-poster {
        width: 350px;
        height: 350px;
    }

    #downloadButton {
        font-size: 20px;
    }
}

/* Hide audio element */
#audio {
    display: none;
}
