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

body {
    background-color: #000000;
    color: #EFEEE0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #1D2123;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(250, 205, 102, 0.3);
    border-top: 3px solid #FACD66;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.failure {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #1D2123;
    padding: 32px;
}

.error-message {
    color: #FACD66;
    font-size: 16px;
    text-align: center;
    max-width: 600px;
}

.dashboard {
    background-color: #000000;
    min-height: 100vh;
    overflow-y: auto;
    padding-bottom: 32px;
}

.dashboard-container {
    max-width: 100%;
}

.top-chart {
    aspect-ratio: 375/600; /* Increased height from 450 to 600 */
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    background-color: #000000;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.top-chart-slider {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 0;
}

.top-chart-slides {
    display: flex;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-chart-slide {
    min-width: 100vw;
    height: 100%;
    position: relative;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border-radius: 0;
}

.top-chart-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        rgba(0,0,0,0) 0%,
        rgba(0,0,0,0.1) 40%,
        rgba(0,0,0,0.3) 60%,
        rgba(0,0,0,0.7) 80%,
        rgba(0,0,0,0.9) 95%,
        rgba(0,0,0,1) 100% /* Black overlay at bottom */
    );
    z-index: 1;
    border-radius: 0;
}

.top-chart-slide-content {
    position: absolute;
    bottom: 120px; /* Moved up to make room for controls */
    left: 16px;
    right: 16px;
    z-index: 2;
}

.top-chart-content {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    z-index: 2;
}

.top-chart-main-title {
    font-size: 16px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    opacity: 0.9;
}

.top-chart-title {
    font-size: 16px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-chart-description {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 24px;
}

.top-chart-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Video ID display in title line */
.top-chart-video-id {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 20px;
    font-weight: normal;
}

/* Bottom controls container */
.top-chart-controls {
    position: absolute;
    bottom: 60px; /* Moved up by 40px (was 20px) */
    left: 16px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 20px; /* Fixed 20px spacing between containers */
}

/* Basic controls container (play and favorites buttons) */
.top-chart-basic-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 44px;
    width: auto;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 22px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Play button */
.top-chart-home-button {
    width: 50px; /* Slightly smaller to fit better */
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    opacity: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.top-chart-home-button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.top-chart-home-button img {
    width: 22px;
    height: 22px;
    filter: brightness(1.2);
}

/* Favorites button */
.top-chart-favorites-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    opacity: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.top-chart-favorites-button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.top-chart-favorites-button.active {
    background: rgba(250, 205, 102, 0.2);
    border: 2px solid #FACD66;
}

.top-chart-favorites-button img {
    width: 22px;
    height: 22px;
    filter: brightness(1.2);
}

/* Add favorite container */
.top-chart-add-favorite-container {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    /* No margin needed since parent uses flex gap for spacing */
}

/* Add favorite button */
.top-chart-add-favorite-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    opacity: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.top-chart-add-favorite-button:hover {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
}

.top-chart-add-favorite-button img {
    width: 20px;
    height: 20px;
    filter: brightness(1.2);
}

/* Add favorite text */
.top-chart-add-favorite-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Favorite tooltip styling */
#favorite-tooltip {
    position: absolute !important;
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    white-space: nowrap !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5) !important;
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1000;
    left: 100% !important;
    margin-left: 8px !important;
    top: 50% !important;
}

.top-chart-icon {
    color: #FACD66;
    font-size: 24px;
}

.top-chart-likes {
    font-size: 20px;
    color: white;
}

.top-chart-dots {
    position: absolute;
    bottom: 20px; /* Moved down by 25px (was 20px) */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px; /* Increased gap from 8px to 10px for better spacing */
    z-index: 3;
}

.top-chart-dot {
    width: 10px; /* Increased from 8px to 10px */
    height: 10px; /* Increased from 8px to 10px */
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.top-chart-dot.active {
    background-color: #FACD66;
    transform: scale(1.2);
}

.cultures {
    margin-top: 46px;
}

.natures {
    margin-top: 60px;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    color: #EFEEE0;
    margin-bottom: 16px;
    padding-left: 16px;
}

.video-list {
    display: flex;
    gap: 10px;
    padding: 20px 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    min-height: 320px;
}

.music-list {
    display: flex;
    gap: 10px;
    padding: 0 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
}

.video-list::-webkit-scrollbar, .music-list::-webkit-scrollbar {
    height: 0px;
    width: 0px;
    display: none;
}

.video-list::-webkit-scrollbar-track, .music-list::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.video-list::-webkit-scrollbar-thumb, .music-list::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}

.video-list, .music-list {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.culture-item, .nature-item {
    min-width: 280px;
    border-radius: 6px;
    padding: 8px;
    padding-top: 16px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.culture-item:hover, .nature-item:hover {
    transform: translateY(-6px) scale(1.02);
}

.culture-thumbnail {
    width: 100%;
    aspect-ratio: 3/4; /* 3:4 ratio for cultures */
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 16px;
}

.nature-thumbnail {
    width: 100%;
    aspect-ratio: 4/3; /* 4:3 ratio for natures */
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: 16px;
}

.item-title-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.item-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0; /* Allows text to shrink if needed */
}

.item-id {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    flex-shrink: 0; /* Prevents ID from shrinking */
}

/* Responsive adjustments for video items */
@media (max-width: 768px) {
    .item-title-container {
        gap: 6px; /* Slightly smaller gap on mobile */
    }

    .item-title {
        font-size: 12px; /* Slightly smaller title on mobile */
    }

    .item-id {
        font-size: 12px; /* Slightly smaller ID on mobile */
    }
}

.item-favorite {
    font-size: 12px;
    color:rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

/* Text elements with unique ID styling */
[id^="video-title-"] {
    font-size: 16px;
    color:rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[id^="video-desc-"] {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 7px;
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[id^="video-artist-"] {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 7px;
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[id^="video-likes-"] {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

[id^="video-likes-"] span {
    display: inline-block;
}

.video-tracks {
    font-size: 16px;
    color: white;
}

.music-item {
    min-width: 153px;
    padding-top: 12px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-item:hover {
    transform: translateY(-6px) scale(1.02);
}

.music-thumbnail {
    width: 153px;
    height: 153px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 16px;
}

.music-title {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.music-tracks {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

@media (max-width: 1024px) {
    /* Tablet adjustments */
    .top-chart-controls {
        bottom: 60px; /* Moved up by 40px (was 15px) */
        gap: 18px; /* Slightly reduced gap for tablets */
        left: 14px;
        right: 14px;
    }

    .top-chart-add-favorite-text {
        display: none; /* Hide text on tablets to save space */
    }

    .top-chart-dots {
        bottom: 20px; /* Position between desktop and mobile */
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .top-chart {
        margin: 0;
    }

    .top-chart-main-title {
        font-size: 16px;
    }

    .top-chart-title {
        font-size: 18px;
    }

    .top-chart-description {
        font-size: 14px;
    }

    .top-chart-video-id {
        font-size: 12px;
        margin-left: 16px;
    }

    .top-chart-controls {
        bottom: 50px; /* Moved up by 40px (was 10px) */
        gap: 14px; /* Further reduced gap on mobile for space */
        left: 8px;
        right: 8px;
    }

    .top-chart-basic-controls {
        height: 40px;
        min-width: 120px;
        padding: 0 12px;
        gap: 12px;
    }

    .top-chart-home-button,
    .top-chart-favorites-button {
        width: 36px;
        height: 36px;
    }

    .top-chart-home-button img,
    .top-chart-favorites-button img {
        width: 16px;
        height: 16px;
    }

    .top-chart-add-favorite-container {
        display: flex; /* Show container on mobile */
        align-items: center;
        gap: 4px; /* Further reduce gap on mobile for better fit */
    }

    .top-chart-add-favorite-button {
        width: 36px; /* Slightly smaller on mobile */
        height: 36px;
        font-size: 16px;
    }

    .top-chart-add-favorite-text {
        display: none; /* Hide text only on mobile to save space */
    }

    .top-chart-dots {
        bottom: 20px; /* Moved down by 25px (was 10px) */
        gap: 10px; /* Increased gap from 8px to 10px for better spacing */
    }

    .video-item {
        min-width: 240px;
        padding-top: 16px;
    }

    .video-thumbnail {
        width: 100%;
        aspect-ratio: 3/4;
    }

    .music-item {
        min-width: 120px;
        padding-top: 12px;
    }

    .music-thumbnail {
        width: 120px;
        height: 120px;
    }
}