/* =========================
   CONTAINER (DDS LOOK)
========================= */
#cbq-player {
    max-width: 480px;
    margin: 20px auto;
    padding: 8px;

    border-radius: 16px;

    /* lebih glossy */
    background: linear-gradient(
        to bottom,
        #e6f7ff 0%,
        #bfe9ff 40%,
        #9fd8ff 100%
    );

    border: 2px solid #7a5cff;

    box-shadow:
        inset 0 0 0 2px #e6ccff,
        0 4px 10px rgba(0,0,0,0.25);
}

/* =========================
   HEADER
========================= */
.cbq-header {
    background: linear-gradient(#8f84ff, #5a4fe0);
    border: 1px solid #caa6ff;
    border-radius: 8px;

    color: #fff;
    font-weight: bold;
	font-size: 13px;
    padding: 6px 10px;

    display: flex;
    justify-content: space-between;
    align-items: center;
	width: 100%;
	height: 30px;
	display: inline-flex;
	gap: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* =========================
   TOOLBAR
========================= */
.cbq-toolbar {
    margin-top: 6px;
    padding: 6px;

    display: flex;
    align-items: center;
    gap: 6px;

    background: linear-gradient(#9a8cff, #5a4fe0);
    border: 1px solid #caa6ff;
    border-radius: 8px;
}

/* BUTTON */
.cbq-toolbar button {
    padding: 3px 6px;
    font-size: 12px;
    height: 24px;

    background: linear-gradient(#ffffff, #6fc2ff);
    border: 1px solid #5aa0ff;
    border-radius: 5px;

    color: #003366;
    font-weight: bold;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.9),
        0 1px 2px rgba(0,0,0,0.2);

    cursor: pointer;
}

/* =========================
   PROGRESS
========================= */
.cbq-progress-wrap {
    flex: 1;
    height: 10px;
}

#cbq-progress-bar {
    width: 100%;
    height: 10px;

    background: #eaf6ff;
    border-radius: 10px;
    border: 1px solid #b48cff;

    overflow: hidden;
}

#cbq-progress-fill {
    height: 100%;
    width: 0%;

    background: linear-gradient(#ff7bff, #8a2be2);
}

/* =========================
   PLAYLIST
========================= */
#cbq-playlist {
    margin-top: 8px;
    padding: 4px;

    background: rgba(255,255,255,0.75);
    border: 1px solid #caa6ff;
    border-radius: 10px;

    max-height: 320px;
    overflow-y: auto;
}

#cbq-playlist li {
    height: 30px;
    line-height: 30px;
    padding: 0 8px;

    color: #333;
    font-size: 13px;

    border-bottom: 1px solid rgba(0,0,0,0.05);
}

#cbq-playlist li:hover {
    background: rgba(122,92,255,0.15);
}

#cbq-playlist li.active {
    background: rgba(122,92,255,0.25);
    color: #3f2dbb;
    font-weight: bold;
}

/* =========================
   FILTER
========================= */
.cbq-filter {
    margin-top: 6px;
    padding: 6px;

  	background: linear-gradient(#9a8cff, #5a4fe0);
    border: 1px solid #caa6ff;
    border-radius: 8px;

    display: flex;
    gap: 6px;
}

#cbq-search,
#cbq-patch-filter,
#cbq-sort {
	height: auto;              /* biar ikut isi */
    background: #fff;
    border: 1px solid #5aa0ff;
    border-radius: 5px;
    color: #000;
    font-size: 11px;
    padding: 4px 6px;
}

/* =========================
   FIX FILTER DALAM (ANTI ABU)
========================= */

/* SEARCH + SELECT */
#cbq-search,
#cbq-patch-filter,
#cbq-sort {
    background: linear-gradient(#ffffff, #dff4ff) !important;
    border: 1px solid #5aa0ff !important;
    border-radius: 6px;

    color: #003366 !important;
    font-size: 11px;

    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.9),
        0 1px 2px rgba(0,0,0,0.1);

    outline: none;
}

/* KHUSUS SELECT (INI YANG BIASANYA BIKIN ABU) */
#cbq-patch-filter {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;

    padding-right: 12px; /* biar gak kepotong */
}

/* OPTION DROPDOWN */
#cbq-patch-filter option {
    background: #ffffff;
    color: #000;
}
/* TITLE (KIRI) */
.cbq-title {
    flex: 1;                /* ambil sisa ruang */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* DOWNLOAD BUTTON - SMALL DDS */
.cbq-download-btn {
    padding: 2px 6px !important;   /* kecilin */
    font-size: 11px !important;    /* lebih kecil */
    height: 22px;                  /* fix tinggi */
    line-height: 18px;

    background: linear-gradient(#ffffff, #6fc2ff) !important;
    border: 1px solid #5aa0ff !important;
    color: #003366 !important;
	white-space: nowrap;        /* jangan turun baris */
    overflow: hidden;           /* potong kalau kepanjangan */
    text-overflow: ellipsis;    /* jadi "Und..." */

    max-width: 70px;            /* batas lebar tombol */
    border-radius: 5px;
	flex-shrink: 0; 
    box-shadow:
        inset 0 1px 2px rgba(255,255,255,0.9),
        0 1px 2px rgba(0,0,0,0.2);

    cursor: pointer;
}

/* HOVER */
.cbq-download-btn:hover {
    background: linear-gradient(#ffffff, #4aa3ff) !important;
}

#cbq-share-facebook {
	padding: 2px 6px !important;   /* kecilin */
    font-size: 11px !important;    /* lebih kecil */
    height: 25px;                  /* fix tinggi */
    line-height: 20px;
	
    background: linear-gradient(#ffffff, #6fc2ff) !important;
    border: 1px solid #5aa0ff !important;
    color: #003366 !important;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 768px) {

    #cbq-player {
        max-width: 100%;
        font-size: 15px;
    }

    /* HEADER */
    .cbq-header {
		display: flex;
    	align-items: center;
   	    justify-content: space-between;
  
        flex-direction: row;
        text-align: center;
        gap: 5px;
    }
	/* NOW PLAYING MOBILE */
	#cbq-now {
		flex: 1;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
		font-size: 13px;
	}
	#cbq-now span {
        display: inline-block;
    }
	/* aktif kalau panjang */
	#cbq-now.marquee span {
		padding-left: 100%;
		animation: cbq-marquee 10s linear infinite;
	}
	/* WRAPPER */
	.mode-mini #cbq-now {
		position: relative;
		overflow: hidden;
		white-space: nowrap;
	}

	/* TEXT */
	.mode-mini #cbq-now span {
		display: inline-block;
		padding-left: 100%;
	}

	/* ANIMATION */
	.mode-mini #cbq-now.marquee span {
		animation: cbq-marquee 8s linear infinite;
	}
    /* SHARE FULL */
    #cbq-share-facebook {
        width: auto;         /* 🔥 jangan full */
    	flex-shrink: 0;      /* biar gak gepeng */
    }
	.cbq-header-right {
		display: flex;
		align-items: center;
		gap: 4px;
		flex-shrink: 0;
	}
    /* TOOLBAR WRAP */
    .cbq-toolbar {
        flex-wrap: wrap;
    }

    .cbq-toolbar button {
        flex: 1;
        padding: 8px;
        height: auto;
        font-size: 14px;
    }

    /* PROGRESS KE BAWAH */
    .cbq-progress-wrap {
        width: 100%;
        order: 10;
    }

    #cbq-progress-bar {
        height: 14px;
    }

    /* TIME */
    .cbq-time {
        width: 100%;
        text-align: center;
        font-size: 13px;
    }

    /* FILTER STACK */
    .cbq-filter {
        flex-direction: column;
    }

    #cbq-search,
    #cbq-patch-filter {
        width: 100%;
        font-size: 14px;
        padding: 8px;
    }

    /* PLAYLIST */
    #cbq-playlist li {
        height: auto;
        line-height: normal;
        padding: 10px;
        font-size: 14px;
    }

    /* TOUCH FIX */
    button {
        -webkit-tap-highlight-color: transparent;
    }

    #cbq-playlist {
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================
   MODE FULL (MAIN PAGE)
========================= */
#cbq-player.mode-full {
    max-width: 480px;
    margin: 20px auto;
    position: relative;
}

/* =========================
   MINI PLAYER MODE (REAL)
========================= */
/* tombol kanan */
.cbq-header-right {
    display: flex;
	align-items: center;   /* 🔥 ini yang bikin sejajar tengah */
    gap: 4px;
}


/* default mini = collapsed */
/* MINI MODE */
.mode-mini {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 260px;
    z-index: 99999;
	
}

/* EXPANDED */
.mode-mini.expanded {
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
}
/* RIGHT BUTTON GROUP */
.mode-mini .cbq-header-right {
    flex-shrink: 0; /* jangan mengecil */
    display: flex;
	align-items: center;   /* 🔥 ini yang bikin sejajar tengah */
    gap: 4px;
}
/* SHARE BUTTON KECIL */
.mode-mini #cbq-share-facebook {
    padding: 2px 4px !important;
    font-size: 10px !important;
    height: 20px;
}

/* TOGGLE BUTTON */
.mode-mini #cbq-toggle {
    font-size: 12px;
    padding: 2px 4px;
}
/* bagian yang disembunyikan */
.mode-mini:not(.expanded) #cbq-playlist,
.mode-mini:not(.expanded) .cbq-filter,
.mode-mini:not(.expanded) .cbq-progress-wrap,
.mode-mini:not(.expanded) #cbq-time {
    display: none !important;
}


/* tombol toggle */
#cbq-toggle {
    margin-left: auto;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
}

/* =========================
   MINI: FILTER SIZE FIX
========================= */
.mode-mini .cbq-filter {
    gap: 4px;
    padding: 4px;
}

/* SELECT + INPUT */
.mode-mini #cbq-search,
.mode-mini #cbq-patch-filter,
.mode-mini #cbq-sort {
    font-size: 11px;
    padding: 3px 5px;
    height: 22px;
}

/* BIAR PROPORSIONAL */
.mode-mini #cbq-patch-filter {
    flex: 1;
    min-width: 80px;
}

.mode-mini #cbq-sort {
    flex: 1;
    min-width: 80px;
}

.mode-mini #cbq-search {
    flex: 2;
}
.mode-mini #cbq-search {
    max-width: 120px;
}
/* =========================
   HIDE TIME SAAT EXPAND
========================= */
.mode-mini.expanded .cbq-time {
    display: none !important;
}
/* HIDE YANG GAK PERLU 
.mode-mini #cbq-playlist,
.mode-mini .cbq-filter,
.mode-mini #cbq-share-facebook,
.mode-mini .cbq-progress-wrap,
.mode-mini .cbq-time {
    display: none !important;
}
*/
/* HEADER JADI KECIL */
.mode-mini .cbq-header {
	display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 6px;
    font-size: 11px;
}

/* TOOLBAR CENTER */
.mode-mini .cbq-toolbar {
    justify-content: center;
    padding: 4px;
    gap: 4px;
}

/* BUTTON KECIL */
.mode-mini .cbq-toolbar button {
    font-size: 11px;
    padding: 4px 6px;
    height: auto;
}

/* TITLE POTONG */
.mode-mini #cbq-now {
	flex: 1;
    min-width: 0; /* 🔥 penting biar ellipsis jalan */
	position: relative;
    font-size: 11px;
    text-align: center;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TEXT */
.mode-mini #cbq-now span {
    display: inline-block;
    padding-left: 100%; /* mulai dari kanan */
}

/* ANIMATION */
.mode-mini #cbq-now.marquee span {
    animation: cbq-marquee 8s linear infinite;
}

@keyframes cbq-marquee {
    0%   { transform: translateX(0%); }
    100% { transform: translateX(-100%); }
}


.mode-mini {
    transition: all 0.25s ease;
}
#cbq-player {
    transition: all 0.3s ease;
}
/* =========================
   MINI: PLAYLIST LIMIT 4 ITEM
========================= */
.mode-mini #cbq-playlist {
    max-height: 120px; /* kira2 4 item */
    overflow-y: auto;
}
/* BIAR GAK KEPOTONG DI MOBILE */
@media (max-width: 768px) {
    .mode-mini {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
    }
}

.ai-player-block.mode-mini {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 300px;
    z-index: 9999;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}