/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #1db954;
    --primary-hover: #1ed760;
    --bg-gradient-start: #121212;
    --bg-gradient-end: #191414;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-secondary: #b3b3b3;
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), #2c0e37);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    overflow-x: hidden;
}

/* Header */
header {
    margin-bottom: 3rem;
    text-align: center;
    animation: fadeInDown 0.8s ease;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #1db954, #1ed760);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(29, 185, 84, 0.3);
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Main Container */
main {
    width: 100%;
    max-width: 1200px;
    /* Wider for grid */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Input Section */
.input-section {
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}

.input-group {
    display: flex;
    gap: 10px;
}

input[type="text"] {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

button.action-btn {
    background: var(--primary-color);
    border: none;
    border-radius: 12px;
    padding: 0 24px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.action-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.4);
}

button.action-btn i {
    font-size: 1.2rem;
}

/* Results Section */
.results-section {
    width: 100%;
    margin-top: 2rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.song-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease backwards;
}

.song-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.song-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.song-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-btn:hover {
    background: var(--primary-color);
    color: white;
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

.download-btn.loading .loader {
    display: block;
}

.download-btn.loading span {
    display: none;
}

.btn-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-group .download-btn {
    width: auto;
    flex: 1;
}


.play-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ffffff;
    background: transparent;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.play-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
}

.play-btn.playing {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.play-btn .loader {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: white;
}

.play-btn.loading .loader {
    display: block;
}

.play-btn.loading span,
.play-btn.loading i {
    display: none;
}

/* Footer */
footer {
    margin-top: 4rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

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

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

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .input-group {
        flex-direction: column;
    }

    .action-btn {
        padding: 12px;
    }
}

/* Audio Player */
.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(24, 24, 24, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

.audio-player.hidden {
    transform: translateY(100%);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 20%;
}

.player-info img {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

.player-text h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
    color: white;
}

.player-text p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.control-btn:hover {
    color: white;
}

.control-btn.play {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.control-btn.play:hover {
    transform: scale(1.05);
}

.player-progress {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    max-width: 40%;
}

#progress-bar {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: var(--text-secondary);
    border-radius: 2px;
    cursor: pointer;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
}

#current-time,
#duration {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 35px;
}

/* Responsive Player */
@media (max-width: 768px) {
    .audio-player {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .player-info,
    .player-progress {
        width: 100%;
        max-width: 100%;
    }

    .player-progress {
        order: -1;
    }
}/* Live TV Styles */
#live-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.video-container {
    width: 100%;
    margin-bottom: 20px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#live-video {
    width: 100%;
    max-height: 500px;
    display: block;
}

.channel-list-container {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom Scrollbar for channel list */
.channel-list-container::-webkit-scrollbar {
    width: 8px;
}

.channel-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.channel-list-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.channel-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

.channel-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 5px 15px rgba(29, 185, 84, 0.2);
}

.channel-card.active {
    border-color: var(--primary);
    background: rgba(29, 185, 84, 0.1);
}

.channel-card img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 50%;
    background: #fff;
    /* fallback for transparent logos */
    padding: 5px;
}

.channel-card h4 {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    word-break: break-word;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    #live-video {
        max-height: 300px;
    }
}
/* Category Dropdown */
#category-filter {
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

#category-filter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(29, 185, 84, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

#category-filter option {
    background: #121212;
    color: white;
}

@media (max-width: 600px) {
    #category-filter {
        width: 100%;
        margin-top: 10px;
    }
}
/* Navbar Styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #1db954, #1ed760);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 20px;
}

.nav-links li a:hover,
.nav-links li a.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-links li a.active {
    color: var(--primary-color);
    background: rgba(29, 185, 84, 0.1);
}

/* Adjust Main for Fixed Navbar */
body {
    padding-top: 80px;
    /* Space for navbar */
}

main {
    margin-top: 2rem;
}

/* Live TV Access Bar Improvements */
.live-toolbar {
    display: flex;
    gap: 15px;
    width: 100%;
}

.live-toolbar input {
    flex: 2;
    border-radius: 50px;
    /* Pill shape */
    padding-left: 20px;
}

.live-toolbar select {
    flex: 1;
    border-radius: 50px;
    padding-left: 20px;
    background-image: linear-gradient(45deg, transparent 50%, gray 50%),
        linear-gradient(135deg, gray 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(1em + 2px),
        calc(100% - 15px) calc(1em + 2px);
    background-size: 5px 5px,
        5px 5px;
    background-repeat: no-repeat;
}

/* Remove Old Styles if needed (Optional override) */
header {
    display: none;
}

.tabs {
    display: none;
}
