/* ============================================================
   KILA Music Player — WordPress Plugin Stylesheet
   Palette: Ungu #7B2D8B | Kuning #F9C942 | Putih #FAFAFA
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Poppins:wght@400;500;600;700&display=swap');

/* ---------- RESET SCOPE ---------- */
.kila-wrapper *, .kila-wrapper *::before, .kila-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---------- WRAPPER ---------- */
.kila-wrapper {
    font-family: 'Nunito', sans-serif;
    background: #FAFAFA;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(123,45,139,.15);
    max-width: 1100px;
    margin: 0 auto 2rem;
    border: 2px solid #e8d5f0;
}

/* ---------- HEADER ---------- */
.kila-header {
    background: linear-gradient(135deg, #7B2D8B 0%, #5a1d68 100%);
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.kila-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kila-logo-icon {
    font-size: 2.2rem;
    background: #F9C942;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(249,201,66,.4);
    flex-shrink: 0;
}

.kila-logo-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #F9C942;
    line-height: 1.2;
}

.kila-logo-sub {
    font-size: .8rem;
    color: rgba(255,255,255,.7);
    font-weight: 600;
    letter-spacing: .5px;
    margin-top: 2px;
}

/* ---------- SEARCH ---------- */
.kila-search-wrap {
    flex: 0 0 260px;
}

.kila-search {
    width: 100%;
    padding: 10px 16px;
    border-radius: 50px;
    border: 2px solid rgba(255,255,255,.3);
    background: rgba(255,255,255,.15);
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    outline: none;
    transition: border .2s, background .2s;
}

.kila-search::placeholder { color: rgba(255,255,255,.6); }
.kila-search:focus {
    border-color: #F9C942;
    background: rgba(255,255,255,.22);
}

/* ---------- TABLE WRAPPER ---------- */
.kila-table-wrap {
    overflow-x: auto;
    max-height: 420px;
    overflow-y: auto;
}

.kila-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.kila-table-wrap::-webkit-scrollbar-track { background: #f0e8f5; }
.kila-table-wrap::-webkit-scrollbar-thumb { background: #b57ec7; border-radius: 4px; }

/* ---------- TABLE ---------- */
.kila-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.kila-table thead {
    background: #f3e6f9;
    position: sticky;
    top: 0;
    z-index: 2;
}

.kila-table thead th {
    padding: 12px 14px;
    text-align: center;
    font-weight: 800;
    color: #5a1d68;
    font-size: .78rem;
    letter-spacing: .6px;
    text-transform: uppercase;
    border-bottom: 2px solid #d9b8ea;
    white-space: nowrap;
}

.kila-table thead th:nth-child(2) { text-align: left; }
.kila-table thead th:nth-child(3) { text-align: left; }

.kila-table tbody tr {
    border-bottom: 1px solid #f0e4fa;
    transition: background .15s;
    cursor: pointer;
}

.kila-table tbody tr:hover { background: #fdf4ff; }
.kila-table tbody tr.kila-active { background: #f3e6f9 !important; }

.kila-table tbody td {
    padding: 11px 14px;
    color: #333;
    text-align: center;
    vertical-align: middle;
}

.kila-table tbody td:nth-child(2) { text-align: left; font-weight: 700; color: #3a1048; }
.kila-table tbody td:nth-child(3) { text-align: left; color: #666; }

.kila-num {
    font-weight: 800;
    color: #9b59b6;
    font-size: .85rem;
}

.kila-year-badge {
    display: inline-block;
    background: #F9C942;
    color: #5a1d68;
    font-weight: 800;
    font-size: .75rem;
    padding: 2px 9px;
    border-radius: 50px;
}

/* ---- Action Buttons ---- */
.kila-btn-play, .kila-btn-dl, .kila-btn-share {
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, box-shadow .15s;
    outline: none;
}

.kila-btn-play {
    background: #7B2D8B;
    color: #fff;
    box-shadow: 0 3px 10px rgba(123,45,139,.35);
}

.kila-btn-play:hover { transform: scale(1.12); box-shadow: 0 5px 14px rgba(123,45,139,.45); }
.kila-btn-play.kila-playing { background: #F9C942; color: #5a1d68; }

.kila-btn-dl {
    background: #e8f5e9;
    color: #2e7d32;
    box-shadow: 0 2px 8px rgba(46,125,50,.15);
}

.kila-btn-dl:hover { transform: scale(1.12); background: #c8e6c9; }
.kila-btn-dl.kila-no-url { opacity: .35; cursor: not-allowed; }

.kila-btn-share {
    background: #e3f2fd;
    color: #1565c0;
    box-shadow: 0 2px 8px rgba(21,101,192,.15);
}

.kila-btn-share:hover { transform: scale(1.12); background: #bbdefb; }

/* ---------- NOW PLAYING BAR ---------- */
.kila-player {
    background: linear-gradient(135deg, #5a1d68 0%, #7B2D8B 100%);
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    animation: kilaSlideUp .3s ease;
}

@keyframes kilaSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.kila-player-cover {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #F9C942;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    overflow: hidden;
}

.kila-player-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

.kila-player-info {
    flex: 0 0 200px;
    min-width: 0;
}

.kila-player-title {
    color: #F9C942;
    font-weight: 800;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kila-player-composer {
    color: rgba(255,255,255,.7);
    font-size: .77rem;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Controls */
.kila-player-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.kila-ctrl {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    outline: none;
}

.kila-ctrl:hover { background: rgba(255,255,255,.28); transform: scale(1.08); }

.kila-play-btn {
    background: #F9C942 !important;
    color: #5a1d68 !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 1.1rem !important;
    box-shadow: 0 4px 12px rgba(249,201,66,.4);
}

/* Progress */
.kila-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 140px;
}

.kila-time {
    color: rgba(255,255,255,.7);
    font-size: .73rem;
    font-weight: 700;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.kila-progress {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,.25);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

.kila-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    background: #F9C942;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,.3);
}

/* Volume */
.kila-volume-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .85rem;
}

.kila-volume {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,.25);
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

.kila-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    background: #F9C942;
    border-radius: 50%;
    cursor: pointer;
}

/* ---------- SHARE MODAL ---------- */
.kila-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.kila-modal.kila-open { display: flex; }

.kila-modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px 24px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    position: relative;
    animation: kilaPop .25s ease;
}

@keyframes kilaPop {
    from { opacity: 0; transform: scale(.88); }
    to   { opacity: 1; transform: scale(1); }
}

.kila-modal-box h3 {
    font-family: 'Poppins', sans-serif;
    color: #5a1d68;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.kila-modal-box p {
    color: #888;
    font-size: .85rem;
    margin-bottom: 18px;
    font-weight: 600;
}

.kila-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: #f0e8f5;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    color: #7B2D8B;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kila-share-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.kila-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity .15s, transform .15s;
}

.kila-share-btn:hover { opacity: .85; transform: translateY(-1px); }
.kila-wa   { background: #25D366; color: #fff; }
.kila-fb   { background: #1877F2; color: #fff; }
.kila-tw   { background: #000; color: #fff; }
.kila-copy { background: #7B2D8B; color: #fff; }

.kila-share-url {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e8d5f0;
    border-radius: 8px;
    font-size: .8rem;
    color: #555;
    outline: none;
    font-family: monospace;
}

/* ---------- EMPTY STATE ---------- */
.kila-empty {
    text-align: center;
    padding: 40px 20px;
    color: #bbb;
    font-size: 1rem;
    font-weight: 600;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
    .kila-header { flex-direction: column; align-items: flex-start; }
    .kila-search-wrap { width: 100%; flex: none; }
    .kila-player { gap: 10px; }
    .kila-player-info { flex: 1; min-width: 0; }
    .kila-progress-wrap { min-width: 100%; order: 10; }
    .kila-volume-wrap { display: none; }
}
