/* ================= RESPONSIVE ENHANCEMENTS ================= */
/* Giữ sidebar/menu như cũ - chỉ responsive content chính */

/* MOBILE: < 650px */
@media screen and (max-width: 650px) {
    .app-layout {
        flex-wrap: wrap;
    }

    .sidebar {
        width: 100%;
        order: -1;
        border-right: none;
        border-bottom: 1px solid #282828;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        gap: 8px;
    }

    .logo {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .logo h2 {
        font-size: 14px;
    }

    .nav-menu {
        flex-direction: row;
        gap: 6px;
        margin-bottom: 0;
        flex-wrap: wrap;
        flex: 1;
    }

    .nav-item {
        font-size: 10px;
        padding: 6px 8px;
        white-space: nowrap;
    }

    .nav-item i {
        margin-right: 3px;
    }

    .playlists-section {
        display: none;
    }

    .main-content {
        width: 100%;
        padding: 12px;
        height: calc(100vh - 150px);
        overflow-y: auto;
    }

    .greeting-title {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .banner-carousel-container {
        gap: 8px;
    }

    .carousel-btn {
        font-size: 14px;
        width: 28px;
        height: 28px;
    }

    .banner-item {
        flex: 0 0 calc(100% - 8px);
        height: 80px;
        border-radius: 4px;
    }

    .banner-text h3 {
        font-size: 12px;
        font-weight: 600;
    }

    .carousel-track-wrapper {
        margin: 0 8px;
    }

    .featured-banner {
        padding: 12px;
        border-radius: 4px;
    }

    .featured-banner h2 {
        font-size: 14px;
        margin: 8px 0;
    }

    .featured-banner .tag {
        font-size: 10px;
    }

    .featured-banner .banner-desc {
        font-size: 11px;
        margin: 6px 0;
    }

    .btn-explore {
        padding: 6px 12px;
        font-size: 11px;
    }

    .pro-track-header {
        flex-direction: column;
        gap: 8px;
    }

    .pro-track-header h2 {
        font-size: 13px;
    }

    .header-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .view-all,
    .btn-action {
        font-size: 10px;
        padding: 6px 8px;
    }

    .pro-track-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px;
        gap: 8px;
    }

    .track-thumb {
        width: 100%;
        flex-shrink: 0;
    }

    .track-thumb img {
        width: 100%;
        height: 100px;
        border-radius: 3px;
    }

    .track-body {
        width: 100%;
    }

    .track-body h4 {
        font-size: 11px;
        margin: 4px 0 2px;
    }

    .track-body p {
        font-size: 10px;
        color: #999;
    }

    .track-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .pro-track-list {
        max-height: 350px;
    }

    .genre-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .genre-card {
        height: 60px;
        font-size: 11px;
    }

    .album-card {
        min-width: 100px;
    }

    .album-card img {
        margin-bottom: 6px;
    }

    .album-card h4 {
        font-size: 11px;
    }

    .album-card p {
        font-size: 9px;
    }

    .player-bar {
        gap: 6px;
        padding: 8px 10px;
        height: auto;
        flex-direction: column;
    }

    .now-playing {
        width: 100%;
        gap: 8px;
    }

    .now-playing img {
        width: 35px;
        height: 35px;
        flex-shrink: 0;
    }

    .playing-info h4 {
        font-size: 10px;
    }

    .playing-info p {
        font-size: 9px;
    }

    .player-controls-wrapper {
        width: 100%;
    }

    .controls-buttons {
        gap: 8px;
        font-size: 12px;
    }

    .play-circle {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .playback-bar {
        max-width: 100%;
        gap: 6px;
    }

    .time {
        font-size: 8px;
    }

    .extra-controls {
        width: 100%;
        justify-content: center;
        gap: 8px;
        font-size: 12px;
    }

    .volume-bg {
        width: 50px;
    }

    .search-input-container {
        max-width: 100%;
    }

    .recent-card img {
        width: 50px;
        height: 50px;
    }

    .track-header,
    .track-row {
        grid-template-columns: 20px 1fr 20px;
        font-size: 9px;
        padding: 6px 8px;
    }

    .col-album {
        display: none;
    }

    .now-playing-card {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .now-playing-thumb {
        width: 80px;
        height: 80px;
    }

    .now-playing-title {
        font-size: 14px;
    }

    .now-playing-artist {
        font-size: 11px;
    }

    .section-header-main {
        margin-top: 12px;
    }

    .section-header-main h2 {
        font-size: 13px;
    }

    .see-all {
        font-size: 10px;
    }

    .page-title {
        font-size: 14px;
    }

    .section-title-search {
        font-size: 12px;
    }

    footer {
        font-size: 9px;
        padding: 8px;
    }
}

/* TABLET: 651px - 1024px */
@media screen and (min-width: 651px) and (max-width: 1024px) {
    .app-layout {
        flex-wrap: wrap;
    }

    .sidebar {
        width: 100%;
        order: -1;
        border-right: none;
        border-bottom: 1px solid #282828;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 12px;
    }

    .logo {
        margin-bottom: 0;
    }

    .nav-menu {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 0;
        flex-wrap: wrap;
    }

    .nav-item {
        font-size: 11px;
        padding: 8px 10px;
    }

    .playlists-section {
        display: none;
    }

    .main-content {
        width: 100%;
        padding: 14px;
        height: calc(100vh - 160px);
        overflow-y: auto;
    }

    .greeting-title {
        font-size: 14px;
    }

    .banner-item {
        flex: 0 0 calc(100% - 10px);
        height: 100px;
    }

    .banner-text h3 {
        font-size: 13px;
    }

    .carousel-track-wrapper {
        margin: 0 12px;
    }

    .carousel-btn {
        font-size: 14px;
    }

    .featured-banner {
        padding: 14px;
    }

    .featured-banner h2 {
        font-size: 15px;
    }

    .featured-banner .banner-desc {
        font-size: 11px;
    }

    .btn-explore {
        padding: 7px 14px;
        font-size: 11px;
    }

    .pro-track-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px;
    }

    .track-thumb {
        width: 100%;
    }

    .track-thumb img {
        width: 100%;
        height: 110px;
    }

    .track-body h4 {
        font-size: 11px;
    }

    .track-body p {
        font-size: 10px;
    }

    .pro-track-list {
        max-height: 300px;
    }

    .genre-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .genre-card {
        height: 70px;
        font-size: 11px;
    }

    .album-card {
        min-width: 120px;
    }

    .album-card img {
        margin-bottom: 6px;
    }

    .album-card h4 {
        font-size: 11px;
    }

    .album-card p {
        font-size: 9px;
    }

    .player-bar {
        gap: 8px;
        padding: 8px 10px;
        height: auto;
        flex-direction: column;
    }

    .now-playing {
        width: 100%;
        gap: 8px;
    }

    .now-playing img {
        width: 38px;
        height: 38px;
    }

    .playing-info h4 {
        font-size: 10px;
    }

    .playing-info p {
        font-size: 9px;
    }

    .player-controls-wrapper {
        width: 100%;
    }

    .controls-buttons {
        gap: 10px;
        font-size: 13px;
    }

    .play-circle {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .playback-bar {
        max-width: 100%;
        gap: 7px;
    }

    .time {
        font-size: 8px;
    }

    .extra-controls {
        width: 100%;
        justify-content: center;
        gap: 10px;
        font-size: 13px;
    }

    .volume-bg {
        width: 55px;
    }

    .search-input-container {
        max-width: 100%;
    }

    .recent-card img {
        width: 55px;
        height: 55px;
    }

    .track-header,
    .track-row {
        grid-template-columns: 22px 1fr 22px;
        font-size: 9px;
        padding: 7px 10px;
    }

    .col-album {
        display: none;
    }

    .now-playing-card {
        flex-direction: column;
        gap: 8px;
        padding: 14px;
    }

    .now-playing-thumb {
        width: 90px;
        height: 90px;
    }

    .now-playing-title {
        font-size: 14px;
    }

    .now-playing-artist {
        font-size: 11px;
    }

    .section-header-main {
        margin-top: 12px;
    }

    .section-header-main h2 {
        font-size: 13px;
    }

    .see-all {
        font-size: 10px;
    }

    .page-title {
        font-size: 14px;
    }

    .section-title-search {
        font-size: 12px;
    }

    footer {
        font-size: 9px;
    }
}

/* TABLET: 769px - 1024px */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .main-content {
        width: calc(100% - 360px);
        padding: 22px;
    }

    .greeting {
        font-size: 24px;
    }

    .banner-item {
        flex: 0 0 calc(50% - 10px);
        height: 150px;
    }

    .banner-text h3 {
        font-size: 17px;
    }

    .carousel-track-wrapper {
        margin: 0 22px;
    }

    .featured-banner {
        padding: 26px;
    }

    .featured-banner h2 {
        font-size: 24px;
    }

    .genre-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }

    .genre-card {
        height: 95px;
        font-size: 14px;
    }

    .album-card {
        min-width: 165px;
    }

    .player-bar {
        padding: 0 18px;
        flex-direction: row;
    }

    .now-playing {
        width: 25%;
    }

    .player-controls-wrapper {
        width: 45%;
    }

    .extra-controls {
        width: 30%;
    }

    .pro-track-item {
        flex-direction: row;
    }

    .track-thumb {
        width: 110px;
    }

    .search-input-container {
        max-width: 420px;
    }

    .track-header,
    .track-row {
        grid-template-columns: 35px minmax(180px, 1.5fr) minmax(110px, 1fr) 45px;
    }

    .now-playing-card {
        flex-direction: row;
    }

    .now-playing-thumb {
        width: 130px;
        height: 130px;
    }
}

/* DESKTOP: > 1025px */
@media screen and (min-width: 1025px) {
    .main-content {
        width: calc(100% - 360px);
        padding: 30px 40px;
    }

    .banner-item {
        flex: 0 0 calc(50% - 10px);
        height: 180px;
    }

    .carousel-track-wrapper {
        margin: 0 30px;
    }

    .featured-banner {
        padding: 32px;
    }

    .genre-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }

    .album-card {
        min-width: 180px;
    }

    .player-bar {
        padding: 0 24px;
        flex-direction: row;
    }

    .now-playing {
        width: 30%;
    }

    .player-controls-wrapper {
        width: 40%;
    }

    .extra-controls {
        width: 30%;
    }

    .track-header,
    .track-row {
        grid-template-columns: 40px minmax(250px, 2fr) minmax(150px, 1fr) 60px;
    }

    .search-input-container {
        max-width: 500px;
    }

    .pro-track-item {
        flex-direction: row;
    }

    .track-thumb {
        width: 120px;
    }

    .now-playing-card {
        flex-direction: row;
        gap: 20px;
    }

    .now-playing-thumb {
        width: 160px;
        height: 160px;
    }

    .recent-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ULTRA WIDE: > 1400px */
@media screen and (min-width: 1400px) {
    .recent-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .genre-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .main-content {
        padding: 40px 50px;
    }

    .album-card {
        min-width: 200px;
    }
}

/* Đảm bảo scrollbar hiển thị đúng trên tất cả các thiết bị */
@media screen and (max-width: 768px) {
    .main-content::-webkit-scrollbar {
        width: 4px;
    }

    .pro-track-list::-webkit-scrollbar {
        width: 4px;
    }
}

/* Touch-friendly sizes */
@media (hover: none) and (pointer: coarse) {
    button,
    .btn-lab-detail,
    .btn-explore,
    .album-card,
    .genre-card,
    .track-row {
        min-height: 44px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    a, button {
        padding: 10px 12px;
    }
}

/* Prevent zoom on input focus on iOS */
@media screen and (max-width: 1024px) {
    input,
    textarea,
    select {
        font-size: 16px;
    }
}
