/* ====== Playlist Bar (bottom fixed) ====== */

#playlist-info {
    display: flex;
    width: max-content;
    flex-shrink: 0;
    position: relative;
    background: var(--kot-surface-dark);
    padding: 3px;
    border-radius: 6px 6px 0 0;
    gap: 3px;
}

.info-line.h1playlist {
    background: #2a2a2a;
    border: none;
}

#playlist-container {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 152px;
    z-index: 99;
    overflow: hidden;
    display: none;
    flex-direction: column;
    background: transparent;
    transition: transform 0.1s ease;
}

#playlist-container.minimized {
    transform: translateY(calc(100% - 32px));
}
#playlist-container.minimized .info-line.h1playlist { display: none; }
#playlist-container.minimized #playlist-minimize {
    color: #090909;
    background: #8d8d8d;
    border-top: 3px solid #cacaca;
}
#playlist-container.minimized #playlist-add-tab { display: none; }
#playlist-container.minimized #playlist-share { display: none; }

#playlist {
    white-space: nowrap;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: block;
    width: auto;
    flex-grow: 1;
    background: var(--kot-surface-dark);
    border-radius: 0 6px 0 0;
}

.playlist-item {
    display: inline-block;
    width: auto;
    height: 100%;
    padding: 6px;
    position: relative;
    background-color: var(--kot-surface-dark);
    margin: 0;
}
.playlist-item a {
    display: inline-block;
    height: 100%;
    width: 100%;
}

img.playlist-thumbnail {
    width: 150px;
    height: 85px;
    object-fit: cover;
    border: 1px solid #444444;
    border-radius: 4px;
}

.info-line {
    display: inline-block;
    width: auto;
    min-width: 160px;
    height: auto;
    padding: 2px 6px;
    font-size: 14px;
    background: #404040;
    color: #cccccc;
    font-weight: 500;
    border-radius: 6px 6px 0 0;
    text-transform: lowercase;
    letter-spacing: 0.7px;
    text-align: center;
}
@media (hover: hover) {
    .info-line:hover { background: #3a3a3a; }
}

/* Tabs */
#playlist-tabs {
    display: flex;
    align-items: stretch;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
#playlist-tabs::-webkit-scrollbar { display: none; }

.playlist-tab {
    position: relative;
    width: 30px;
    padding: 4px 8px;
    border-top: 3px solid transparent;
    background: #2a2a2a;
    cursor: pointer;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.1s;
    border-radius: 4px 4px 0 0;
}
.playlist-tab.active { opacity: 1; background: #3a3a3a; }
.playlist-tab-num { font-size: 13px; font-weight: bold; color: var(--text-active, #dddddd); } /* P7 tokenizace */
.playlist-tab.active .playlist-tab-num { display: none; }
#playlist-container.minimized .playlist-tab.active .playlist-tab-num { display: inline; }

.playlist-tab-close {
    position: relative;
    font-size: 18px;
    color: #888888;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}
#playlist-container.minimized .playlist-tab-close { display: none; }
@media (hover: hover) {
    .playlist-tab-close:hover { color: var(--red); }
    .playlist-tab:hover { opacity: 0.85; }
}

#playlist-add-tab {
    cursor: pointer;
    width: 30px;
    min-width: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #aaaaaa;
    background: #333333;
    border-top: 3px solid #555555;
    border-radius: 4px 4px 0 0;
    padding: 0;
}
@media (hover: hover) {
    #playlist-add-tab:hover { background: #444444; color: var(--text-active, #dddddd); }
}

/* Empty state */
.playlist-placeholder {
    display: inline-block;
    height: 100%;
    padding: 6px 4px;
    position: relative;
    background-color: var(--kot-surface-dark);
    margin: 0;
}
.playlist-placeholder-thumb {
    width: 150px;
    height: 85px;
    background: #2a2a2a;
    border: 1px solid #444444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555555;
    font-size: 12px;
    text-transform: lowercase;
}

/* Minimize / Share buttons */
div#playlist-minimize {
    cursor: pointer;
    min-width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333333;
    color: #aaaaaa;
    border-top: 3px solid #555555;
    border-radius: 4px 4px 0 0;
}
div#playlist-share {
    cursor: pointer;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333333;
    color: #aaaaaa;
    border-top: 3px solid #555555;
    border-radius: 4px 4px 0 0;
}
@media (hover: hover) {
    div#playlist-minimize:hover,
    div#playlist-share:hover { background: #444444; color: var(--text-active, #dddddd); }
}
div#playlist-share.share-used { opacity: 1; }
div#playlist-share.share-disabled { opacity: 0.3; pointer-events: none; cursor: default; }

/* Delete button */
.delete-button-list {
    position: absolute;
    right: 4px;
    top: 6px;
    cursor: pointer;
    background-color: rgba(0,0,0,0.7);
    color: #bbbbbb;
    font-weight: bold;
    font-size: 12px;
    display: block;
    padding: 2px 5px;
    border-radius: 3px;
    opacity: 0.85;
}
@media (hover: hover) {
    .delete-button-list:hover { background: var(--red); opacity: 1; }
}

/* Tooltip */
.tooltip-info {
    display: none;
    position: absolute;
    background-color: #dddddd;
    color: #222222;
    padding: 5px;
    border-radius: 5px;
    z-index: 1000;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 500;
}

/* Share modal */
#share-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-modal-content {
    background: var(--kot-surface-dark);
    border: 1px solid #333333;
    border-radius: 8px;
    max-width: 420px;
    width: 90%;
    padding: 24px;
    position: relative;
    color: #cccccc;
}
.share-modal-close {
    position: absolute;
    top: 10px; right: 14px;
    cursor: pointer;
    font-size: 18px;
    color: #888888;
}
@media (hover: hover) {
    .share-modal-close:hover { color: #fff; }
}
.share-modal-content h3 { margin: 0 0 10px; font-size: 18px; color: #fff; }
.share-info { font-size: 13px; color: #888888; margin-bottom: 16px; line-height: 1.4; }
.share-modal-content label { display: block; font-size: 14px; margin-bottom: 6px; color: #aaaaaa; }
#share-playlist-name {
    width: 100%; padding: 8px 10px;
    background: #2a2a2a; border: 1px solid #444444; border-radius: 4px;
    color: #fff; font-size: 14px; margin-bottom: 12px; box-sizing: border-box;
}
#share-generate {
    width: 100%; padding: 10px;
    background: var(--accent); color: #fff; border: none; border-radius: 4px;
    font-size: 15px; cursor: pointer; font-weight: 500;
}
@media (hover: hover) {
    #share-generate:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
}
#share-result { margin-top: 14px; display: flex; align-items: center; gap: 6px; }
.share-url-wrap { position: relative; flex: 1; min-width: 0; }
#share-url {
    width: 100%; padding: 8px 10px;
    background: #2a2a2a; border: 1px solid #444444; border-radius: 4px;
    color: var(--text-active, #dddddd); font-size: 16px; box-sizing: border-box;
}
#share-copy {
    padding: 8px 12px; background: #333333; border: 1px solid #555555;
    border-radius: 4px; color: #cccccc; cursor: pointer; font-size: 15px; flex-shrink: 0;
}
@media (hover: hover) {
    #share-copy:hover { background: #444444; }
}
#share-copied {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: #2a2a2a; border: 1px solid #444444; border-radius: 4px;
    color: var(--green); font-size: 13px; display: none; text-align: center;
    padding: 8px 10px; box-sizing: border-box;
}

/* ====== Mobile ====== */
@media (max-width: 767.98px) {
    #share-playlist-name { font-size: 17px; }

    img.playlist-thumbnail { width: 110px; height: 70px; }

    #playlist-container {
        width: 100%;
        height: 125px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background-color: rgb(0 0 0 / 80%);
    }

    #playlist { border-radius: 0; overflow-y: hidden; background: transparent; }
    .playlist-item { padding: 4px; }
    .info-line { font-size: 15px; min-width: 122px; touch-action: manipulation; }

    /* jen rozdíly proti base — display/align/justify/font-size/padding už platí z base */
    div#playlist-minimize,
    div#playlist-share,
    #playlist-add-tab {
        min-width: 36px; min-height: 30px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255,255,255,0.15);
    }

    .playlist-tab {
        min-width: 34px; min-height: 30px; padding: 0 6px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255,255,255,0.15);
    }

    .delete-button-list {
        top: 4px; right: 2px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255,255,255,0.15);
    }
    .delete-button-list::after {
        content: '';
        position: absolute;
        top: -12px; right: -12px; bottom: -12px; left: -12px;
    }

    .playlist-tab-close {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255,255,255,0.15);
        padding: 4px 6px;
    }
}
