/* Small breakpoint styles (<768px) */
@media (max-width: 768px) {
    /* AdminSongManagement container */
    #grid-container {
        width: 100%;
        height: calc(100vh - 7rem);
    }

    /* SongPlayer - Container adjustments for small screens */
    .song-player-container {
        grid-template-rows: 1fr 80px;
    }

    .song-player-container .song-header {
        padding: 16px;
    }

    .song-player-container .player-bar {
        padding: 10px 16px;
        gap: 6px;
    }

    /* SongPlayer mobile adjustments */
    .song-title {
        font-size: 36px;
    }

    .album-art {
        width: 95px;
        object-fit: cover;
        box-shadow: 0 4px 60px rgba(0, 0, 0, 0.5);
        border-radius: 4px;
    }

    .time-spacer { min-width: 0; display: none; }
    .controls-wrapper { gap: 2px; margin-bottom: 4px; }
    .player-controls { gap: 4px; }
    .player-controls-row { gap: 2px; }
    .volume-bar-container { width: 60px; }
    .volume-controls { gap: 4px; }
    .control-button { width: 28px; height: 28px; }
    .control-icon { width: 14px; height: 14px; }
    .play-button-small { width: 28px; height: 28px; }
    .play-icon-small { width: 14px; height: 14px; }
    .progress-container { gap: 4px; }
    .time-display { min-width: 28px; font-size: 10px; }
    .action-controls { flex-wrap: wrap; gap: 16px; }
    .cart-button-large { padding: 10px 20px; font-size: 13px; }
    .cart-icon-large { width: 18px; height: 18px; }

    /* SongPlayer - Player controls compact layout */
    .song-player-container .controls-wrapper {
        gap: 2px;
        margin-bottom: 4px;
        max-width: 100%;
    }

    .song-player-container .time-spacer {
        display: none;
        min-width: 0;
    }

    .song-player-container .player-controls-row {
        gap: 4px;
        width: 100%;
    }

    .song-player-container .progress-container {
        gap: 4px;
        max-width: 100%;
    }

    /* AlbumPlayer - Container adjustments for small screens */
    .album-player-spotify-container {
        grid-template-rows: auto auto auto 1fr 80px;
    }

    .album-player-spotify-container .album-image-title-row {
        padding: 8px 16px;
    }

    .album-player-spotify-container .action-buttons-row {
        padding: 8px 16px;
    }

    .album-player-spotify-container .status-info-row {
        padding: 8px 16px;
    }

    .album-player-spotify-container .player-bar {
        padding: 10px 16px;
        gap: 6px;
    }

    /* AlbumPlayer - Player controls compact layout */
    .album-player-spotify-container .controls-wrapper {
        gap: 2px;
        margin-bottom: 4px;
        max-width: 100%;
    }

    .album-player-spotify-container .time-spacer {
        display: none;
        min-width: 0;
    }

    .album-player-spotify-container .player-controls-row {
        gap: 4px;
        width: 100%;
    }

    .album-player-spotify-container .player-controls {
        gap: 4px;
    }

    .album-player-spotify-container .volume-controls {
        gap: 4px;
    }

    .album-player-spotify-container .control-button {
        width: 28px;
        height: 28px;
    }

    .album-player-spotify-container .control-icon {
        width: 14px;
        height: 14px;
    }

    .album-player-spotify-container .play-button-small {
        width: 28px;
        height: 28px;
    }

    .album-player-spotify-container .play-icon-small {
        width: 14px;
        height: 14px;
    }

    .album-player-spotify-container .progress-container {
        gap: 4px;
        max-width: 100%;
    }

    .album-player-spotify-container .time-display {
        min-width: 28px;
        font-size: 10px;
    }

    .album-player-spotify-container .volume-bar-container {
        width: 60px;
    }

    .album-player-spotify-container .action-controls {
        flex-wrap: wrap;
        gap: 16px;
    }

    .album-player-spotify-container .cart-button-large {
        padding: 10px 20px;
        font-size: 13px;
    }

    .album-player-spotify-container .cart-icon-large {
        width: 18px;
        height: 18px;
    }

    /* MusicLibrary small adjustments */
    .music-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }

    /* Featured Music Carousel - SM breakpoint: show ~2.2 cards */
    .featured-music-carousel {
        gap: 16px;
        padding-right: 16px;
    }

    .featured-music-carousel .music-card {
        /* 2.2 cards visible: 100vw / 2.2 ≈ 45.45vw per card */
        width: calc(100vw / 2.2 - 24px);
        min-width: calc(100vw / 2.2 - 24px);
    }

    .music-card { padding: 12px; }
    .card-song-title { font-size: 13px; }
    .card-play-button, .card-view-button { width: 36px; height: 36px; }
    .card-play-icon { width: 18px; height: 18px; }
    .card-view-icon { width: 20px; height: 20px; }
    .card-volume-bar-container { width: 40px; }

    .title-container {
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    .song-title {
        font-size: 50px;
        font-weight: 700;
        line-height: 1;
        margin: 0 10px 0 10px;
        padding: 0;
    }

    .track-list {
        width: 100%;
        border-collapse: collapse;
        color: #b3b3b3;
    }

        .track-list thead {
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .track-list th {
            font-size: 12px;
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            padding: 8px 16px;
            text-align: left;
        }

            .track-list th.track-number {
                width: 50px;
                text-align: center;
            }

            .track-list th.track-image {
                width: 50px;
                padding-left: 0;
                padding-right: 0;
            }

            .track-list th.track-duration {
                width: 80px;
                text-align: right;
            }

            .track-list th.track-actions {
                width: 50px;
            }

    .track-row {
        border-radius: 4px;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

        .track-row:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }

        .track-row.current-track {
            background-color: rgba(29, 185, 84, 0.2);
        }

        .track-row td {
            padding: 12px 16px;
        }

            .track-row td.track-number {
                text-align: center;
                position: relative;
            }

    .track-index {
        display: inline;
    }

    .track-play-btn {
        display: none;
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 0;
        width: 16px;
        height: 16px;
    }

        .track-play-btn svg {
            width: 16px;
            height: 16px;
        }

    .track-row:hover .track-index {
        display: none;
    }

    .track-row:hover .track-play-btn {
        display: inline;
    }

    .track-row.current-track .track-index {
        display: none;
    }

    /* Playing Indicator */
    .playing-indicator {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        gap: 2px;
        height: 16px;
    }

        .playing-indicator span {
            width: 3px;
            background-color: #1db954;
            border-radius: 1px;
            animation: soundBars 0.5s ease infinite alternate;
        }

            .playing-indicator span:nth-child(1) {
                height: 60%;
                animation-delay: 0s;
            }

            .playing-indicator span:nth-child(2) {
                height: 100%;
                animation-delay: 0.1s;
            }

            .playing-indicator span:nth-child(3) {
                height: 40%;
                animation-delay: 0.2s;
            }

    @keyframes soundBars {
        0% {
            height: 20%;
        }

        100% {
            height: 100%;
        }
    }

    .track-image {
        padding: 8px !important;
    }

    .track-thumbnail {
        width: 40px;
        height: 40px;
        object-fit: cover;
        border-radius: 2px;
    }

    .track-thumbnail-placeholder {
        width: 40px;
        height: 40px;
        background: #282828;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 2px;
    }

        .track-thumbnail-placeholder svg {
            width: 24px;
            height: 24px;
            fill: #b3b3b3;
        }

    /* Track preview badge - smaller on SM screens */
    .track-preview-badge {
        font-size: 9px;
        padding: 2px 5px;
        margin-left: 6px;
    }

    /* Stream Count on Card */
    .card-stream-count {
        display: flex;
        align-items: center;
        gap: 4px;
        color: #b3b3b3;
        font-size: 11px;
        margin-bottom: 6px;
    }

    .stream-icon {
        width: 11px;
        height: 11px;
        fill: currentColor;
    }
}

/* Landscape Mobile Optimization - for devices with limited viewport height */
@media (max-width: 1200px) and (max-height: 600px) and (orientation: landscape) {
    /* SongPlayer - Landscape adjustments */
    .song-player-container {
        grid-template-rows: 1fr 70px;
    }

    .song-player-container .player-bar {
        padding: 6px 12px;
        gap: 2px;
    }

    /* AlbumPlayer - Landscape adjustments */
    .album-player-spotify-container {
        grid-template-rows: auto 1fr 70px;
    }

    .album-player-spotify-container .player-bar {
        padding: 6px 12px;
        gap: 2px;
    }

    /* MusicLibrary - Reduce grid gaps and card spacing in landscape */
    .music-cards-grid {
        gap: 12px;
    }

    .music-card {
        padding: 8px;
    }

    /* Reduce album art size to fit more content vertically */
    .card-album-art {
        margin-bottom: 8px;
    }

    /* Reduce title spacing */
    .card-song-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    /* Reduce track count spacing */
    .card-track-count {
        font-size: 11px;
        margin-bottom: 6px;
    }

    /* Compact card actions */
    .card-actions-with-likes {
        gap: 4px;
        margin-top: 6px;
    }

    /* Reduce action button sizes */
    .action-button {
        min-width: 32px !important;
        min-height: 32px !important;
    }

    .action-button .e-btn-icon {
        font-size: 16px !important;
    }

    /* Compact like/dislike buttons */
    .like-button,
    .dislike-button,
    .like-display,
    .dislike-display {
        min-width: 32px !important;
        min-height: 32px !important;
        padding: 6px !important;
    }

    .action-icon,
    .display-icon {
        width: 16px !important;
        height: 16px !important;
    }

    .count-text {
        font-size: 0.75rem !important;
    }

    /* Compact cart button */
    .card-cart-button {
        padding: 6px 10px;
        margin-top: 6px;
        font-size: 12px;
    }

    /* Reduce owned badge size */
    .owned-badge {
        width: 20px;
        height: 20px;
        top: 6px;
        right: 6px;
    }

    .owned-badge svg {
        width: 12px;
        height: 12px;
    }

    /* Reduce album badge size */
    .album-badge {
        font-size: 9px;
        padding: 3px 6px;
        bottom: 6px;
        left: 6px;
    }

    /* Compact mini player controls */
    .card-mini-player {
        gap: 6px;
    }

    .card-mini-controls-row {
        gap: 6px;
    }

    .card-mini-controls {
        gap: 3px;
    }

    .card-volume-controls {
        gap: 2px;
    }

    .card-volume-bar-container {
        width: 50px;
    }

    .card-progress-container {
        gap: 4px;
    }

    .card-time-display {
        font-size: 10px;
    }

    .card-now-playing {
        font-size: 11px;
    }

    /* Reduce library container padding */
    .music-library-container {
        padding: 12px;
    }

    .app-logo {
        height: 32px;
    }

    .home-container {
        padding: 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    /* Hero Section - SM Breakpoint */
    .hero-section {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem 0;
    }

    .hero-content {
        min-width: 100%;
    }

    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }

    .hero-cta {
        justify-content: center;
        gap: 0.75rem;
    }

    .cta-primary,
    .cta-secondary {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .cta-large {
        padding: 14px 32px;
        font-size: 1rem;
    }

    .hero-animation {
        width: 180px;
        height: 180px;
    }

    /* Features Section - SM Breakpoint */
    .features-section {
        padding: 2rem 0;
    }

    .features-section .section-title {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

    .features-grid {
        gap: 1rem;
    }

    .feature-card {
        padding: 1.5rem;
    }

    .feature-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .feature-icon svg {
        width: 32px;
        height: 32px;
    }

    .feature-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .feature-card p {
        font-size: 0.9rem;
        margin: 0;
    }

    /* User Playlists Section - SM Breakpoint */
    .user-playlists-section {
        gap: 1rem;
        padding: 1.5rem 0;
    }

    .user-playlists-section .section-title {
        font-size: 1.5rem;
    }

    /* Featured Music Section - SM Breakpoint */
    .featured-music-section {
        padding: 1.5rem 0;
    }

    .featured-music-section .section-title {
        font-size: 1.5rem;
    }

    .featured-music-section .section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* Subscription CTA Section - SM Breakpoint */
    .subscription-cta-section {
        padding: 2rem 1.5rem;
        margin: 2rem 0;
    }

    .subscription-cta-content h2 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .subscription-price-highlight {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }

    .subscription-price-highlight .price {
        font-size: 2.25rem;
    }

    .subscription-benefits {
        margin-bottom: 1.5rem;
    }

    .subscription-benefits li {
        font-size: 1rem;
        gap: 10px;
        margin-bottom: 0.75rem;
    }
}
