/* JetKTV 2025 Mobile KTV Interface Styling */

body {
    padding-bottom: 85px; /* space for bottom navigation bar */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Top Header & Now Playing Glass Card
   ========================================================================== */
#header-top {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 15, 25, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 10px 14px;
}

.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.brand-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-header-action {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-header-action:active {
    background: var(--primary);
    transform: scale(0.96);
}

/* Now Playing Card */
#status {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

#status::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
}

#nowPlay {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

#playTime {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Outfit', monospace;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 4px;
}

#playMode {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    height: 26px;
}
#playMode img {
    height: 18px;
    width: auto;
    object-fit: contain;
}

#key {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 700;
    min-width: 38px;
    text-align: center;
}

#volume {
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Quick mini controls on player */
.player-quick-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.btn-mini-ctrl {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-mini-ctrl:active {
    transform: scale(0.94);
    background: var(--primary);
}
.btn-mini-cut {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}
.btn-mini-cut:active {
    background: #ef4444;
    color: #fff;
}

/* ==========================================================================
   Global Search Bar & Quick Categories
   ========================================================================== */
.search-wrapper {
    padding: 10px 14px 4px 14px;
}

.search-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    font-size: 15px;
    pointer-events: none;
}

.searchText {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-pill);
    color: #fff;
    padding: 12px 42px 12px 38px;
    font-size: 14px;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.searchText:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    background: rgba(22, 27, 46, 0.95);
}

.btn-search-trigger {
    position: absolute;
    right: 6px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-pill);
    color: #fff;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
}
.btn-search-trigger:active {
    transform: scale(0.94);
}

/* Category Quick Pills */
.category-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-pills::-webkit-scrollbar {
    display: none;
}

.pill-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.pill-item:active, .pill-item.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: scale(0.96);
}

/* ==========================================================================
   Navigation Bar (Menu Back & Home Breadcrumbs)
   ========================================================================== */
.nav-breadcrumbs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 14px 8px 14px;
    gap: 8px;
}
.btn-nav {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s;
    flex: 1;
    justify-content: center;
}
.btn-nav:active {
    background: var(--primary);
    color: #fff;
    transform: scale(0.97);
}
.btn-nav-home {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.btn-nav-home:active {
    background: #10b981;
    color: #fff;
}

/* ==========================================================================
   Main Content Panels (Menu / Playlist / Remote Control)
   ========================================================================== */
.tab-content-panel {
    flex: 1;
    padding: 6px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#playList, #control {
    display: none;
}

/* ==========================================================================
   Table & List Item Beautification (Song / Singer Cards)
   ========================================================================== */
#tbl_menu, #tbl_playlist {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 8px !important;
    margin: 0 !important;
}

/* Hide empty dummy rows */
#tbl_menu tr:empty, #tbl_playlist tr:empty,
#tbl_menu tr td.rowItem:empty,
#tbl_menu tr:has(td.title:empty),
#tbl_playlist tr:has(td.title:empty) {
    display: none !important;
}

td.rowItem {
    padding: 0 !important;
    border: none !important;
}

td.rowItem > table {
    width: 100% !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: var(--radius-md) !important;
    padding: 10px 14px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
}

td.rowItem > table:active {
    background: var(--bg-card-hover) !important;
    border-color: var(--primary) !important;
    transform: scale(0.98) !important;
    box-shadow: var(--shadow-glow) !important;
}

/* Singer badges */
td.singer0, td.singer1, td.singer2, td.singer {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: left !important;
    padding-bottom: 3px !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

/* Female Singer: Rose Pink */
td.singer0 {
    color: #f472b6 !important;
}
td.singer0::before {
    content: '👩 ';
    font-size: 12px;
}

/* Male Singer: Electric Blue */
td.singer1 {
    color: #60a5fa !important;
}
td.singer1::before {
    content: '👨 ';
    font-size: 12px;
}

/* Band / Group: Emerald */
td.singer2 {
    color: #34d399 !important;
}
td.singer2::before {
    content: '👥 ';
    font-size: 12px;
}

/* General Singer */
td.singer {
    color: #fbbf24 !important;
}

/* Song Title */
#menu td.title, #playList td.title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-align: left !important;
    padding: 2px 0 4px 0 !important;
    line-height: 1.3 !important;
    height: auto !important;
    width: auto !important;
    max-width: none !important;
    letter-spacing: 0.3px !important;
}

/* Song Number Badge */
td.number {
    font-size: 11px !important;
    font-family: 'Outfit', monospace !important;
    font-weight: 600 !important;
    color: var(--text-dim) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 2px 8px !important;
    border-radius: var(--radius-pill) !important;
    display: inline-block !important;
    width: auto !important;
    text-align: left !important;
}

/* Playlist specific highlight for Now Playing / First Item */
#playList tr:first-child td.rowItem > table {
    border-left: 4px solid var(--primary) !important;
    background: rgba(99, 102, 241, 0.15) !important;
}
#playList tr:first-child td.rowItem > table td.title::before {
    content: '▶ ';
    color: #38bdf8;
    font-size: 14px;
}

/* ==========================================================================
   Remote Control Panel
   ========================================================================== */
.control-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 6px 0;
}

.control-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.control-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.btn-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.btn-ctrl {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: var(--radius-md);
    padding: 14px 6px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 60px;
}
.btn-ctrl .ctrl-icon {
    font-size: 22px;
    line-height: 1;
}
.btn-ctrl .ctrl-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}
.btn-ctrl:active {
    transform: scale(0.94);
    background: var(--primary);
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}
.btn-ctrl:active .ctrl-label {
    color: #fff;
}

/* Soundboard Effect Pads */
.effect-soundboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.btnEffect {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
    border: 1px solid rgba(236, 72, 153, 0.3) !important;
    color: #fff !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    width: auto !important;
    height: auto !important;
    min-height: 54px !important;
    max-height: none !important;
    margin: 0 !important;
}
.btnEffect:active {
    transform: scale(0.93) !important;
    background: var(--accent-pink) !important;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.5) !important;
}

/* ==========================================================================
   Bottom Floating Glassmorphism Tab Bar
   ========================================================================== */
#bottom-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: rgba(11, 15, 25, 0.94);
    backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) 12px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.5);
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 0;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.tab-btn .tab-icon {
    font-size: 20px;
    line-height: 1;
    transition: transform 0.2s;
}

.tab-btn.active {
    color: #fff;
}
.tab-btn.active .tab-icon {
    transform: translateY(-2px) scale(1.1);
    color: #38bdf8;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
}

.tab-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    background: var(--accent-pink);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: var(--radius-pill);
    min-width: 16px;
    text-align: center;
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.6);
}

/* Hide legacy bottom panels */
.panel, #playListPanel, #menuPanel, #controlPanel {
    display: none !important;
}
