* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0f23, #16213e, #0f3460);
    background-size: 200% 200%;
    min-height: 100vh;
    animation: gradientShift 12s ease infinite;
}

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

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

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

.language-switcher {
    position: relative;
}

.language-switcher button {
    background-color: rgba(29, 185, 84, 0.8);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.language-switcher button:hover {
    background-color: rgba(29, 185, 84, 1);
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
.tutorial-img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.tutorial-img img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}
.kotak {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.auth-section, .stats-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #1db954, #1ed760);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(29, 185, 84, 0.2);
}
.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}
.input-group {
    margin-bottom: 20px;
}
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1ed760;
}
input {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}
input:focus {
    outline: none;
    border-color: #1ed760;
    box-shadow: 0 0 20px rgba(30, 215, 96, 0.3);
}
input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.btn {
    background: linear-gradient(45deg, #1db954, #1ed760);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 5px;
    box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(29, 185, 84, 0.4);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}
.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #1ed760;
    margin-bottom: 10px;
}
.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}
.results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
    height: 70vh;
}
.track-list, .artist-list {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 0; /* Ensures grid item can shrink */
    width: 100%; /* Takes full width of grid cell */
}
.scrollable-content {
    max-height: calc(70vh - 80px);
    overflow-y: auto;
    overflow-x: hidden; /* Prevents horizontal scrolling */
    padding-right: 10px;
    width: 100%;
}
/* Custom Scrollbar */
.scrollable-content::-webkit-scrollbar {
    width: 8px;
}
.scrollable-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
.scrollable-content::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #1db954, #1ed760);
    border-radius: 4px;
}
.scrollable-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #1ed760, #1db954);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(30, 215, 96, 0.3);
}
.section-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #1ed760;
}
.item-count {
    background: rgba(30, 215, 96, 0.2);
    color: #1ed760;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
}
.list-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    min-width: 0; /* Allows flex items to shrink */
    width: 100%;
}
.list-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}
.item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0; /* Prevents image from shrinking */
}
.item-info {
    min-width: 0; /* Allows text content to shrink */
    flex: 1; /* Takes remaining space */
    overflow: hidden; /* Prevents text overflow */
}
.item-info h4 {
    margin-bottom: 5px;
    color: #1ed760;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-info p {
    opacity: 0.8;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.loading {
    text-align: center;
    padding: 20px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-left-color: #1ed760;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: #ff6b6b;
    padding: 15px;
    border-radius: 10px;
    margin: 10px 0;
}
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin: 20px 0;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #1db954, #1ed760);
    transition: width 0.3s ease;
}
.settings-section {
    margin: 20px 0;
}
.time-range-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}
.time-range-option {
    flex: 1;
    min-width: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.time-range-option:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.time-range-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
}
.time-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.time-title {
    font-weight: 600;
    color: #1ed760;
    font-size: 1.1rem;
}
.time-desc {
    font-size: 0.9rem;
    opacity: 0.8;
}
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}
.button-group .btn {
    margin: 0;
}
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    .results-container {
        grid-template-columns: 1fr;
        gap: 20px;
        height: auto;
    }
    .scrollable-content {
        max-height: 50vh;
    }
    .time-range-option {
        min-width: 100%;
    }
    .button-group {
        flex-direction: column;
        width: 100%;
    }
    .button-group .btn {
        width: 100%;
    }
    .container {
        padding: 10px;
    }
    .auth-section, .stats-section {
        padding: 20px 15px;
    }
    .list-item {
        padding: 12px;
        gap: 10px;
    }
    .item-image {
        width: 50px;
        height: 50px;
    }
    .item-info h4 {
        font-size: 0.95rem;
    }
    .item-info p {
        font-size: 0.85rem;
    }
    .prompt-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .prompt-buttons .btn {
        width: 200px;
    }
    
    .leaderboard-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        min-width: unset;
    }
    
    .leaderboard-stats {
        grid-template-columns: 1fr 1fr;
    }
}

/* Leaderboard Styles */
.leaderboard-prompt {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.prompt-card {
    max-width: 400px;
    margin: 0 auto;
}

.prompt-card h3 {
    color: #1ed760;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.prompt-card p {
    margin-bottom: 20px;
    opacity: 0.9;
}

.prompt-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: linear-gradient(45deg, #1db954, #1ed760);
}

.btn-secondary {
    background: linear-gradient(45deg, #666, #888);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    margin: 0;
}

.leaderboard-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 120px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: linear-gradient(45deg, #1db954, #1ed760);
    color: white;
}

.leaderboard-content {
    max-height: 60vh;
}

.leaderboard-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.leaderboard-rank {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1ed760;
    min-width: 40px;
    text-align: center;
}

.leaderboard-rank.top1 {
    color: #FFD700;
}

.leaderboard-rank.top2 {
    color: #C0C0C0;
}

.leaderboard-rank.top3 {
    color: #CD7F32;
}

.leaderboard-user {
    flex: 1;
    min-width: 0;
}

.leaderboard-user h4 {
    color: #1ed760;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    font-size: 0.85rem;
    opacity: 0.8;
}

.leaderboard-date {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 5px;
}