/* Directory */
.upsb-directory {
    position: relative;
}

.upsb-directory.is-loading::after {
    content: '…';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 18px;
    opacity: 0.6;
}

.upsb-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.upsb-search-input {
    flex: 1 1 220px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.upsb-filter-select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
    min-width: 160px;
}

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

/* Σε μεγάλες οθόνες: ΚΛΕΙΔΩΝΟΥΜΕ σε 6 ανά σειρά */
@media (min-width: 1280px) {
    .upsb-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}


.upsb-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    padding: 35px 12px 35px 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.upsb-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.upsb-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upsb-card-thumb {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f4f4;
}

.upsb-card-thumb img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.upsb-card-thumb-placeholder {
    font-size: 28px;
    font-weight: 600;
    color: #777;
}

.upsb-card-title {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
}

/* Bookmark button */
.upsb-bookmark-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    padding: 0;
}

.upsb-bookmark-toggle.is-busy {
    opacity: 0.6;
    pointer-events: none;
}

.upsb-bookmark-icon {
    width: 16px;
    height: 16px;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    background: #bbb;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 4c-1.1 0-2 .9-2 2v14l8-3.5L20 20V6c0-1.1-.9-2-2-2H6z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 4c-1.1 0-2 .9-2 2v14l8-3.5L20 20V6c0-1.1-.9-2-2-2H6z'/%3E%3C/svg%3E");
}

.upsb-bookmark-toggle.is-bookmarked .upsb-bookmark-icon {
    background: #cc3333;
}

.upsb-no-results {
    font-size: 14px;
    color: #666;
}

/* Launcher */
.upsb-launcher {
    position: relative;
    display: inline-block;
}

.upsb-launcher-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.upsb-launcher-icon svg {
    width: 100%;
    height: 100%;
    fill: #444;
}

.upsb-launcher-panel {
    position: absolute;
    right: 0;
    margin-top: 8px;
    z-index: 9999;
    width: 320px;
    max-width: 90vw;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    padding: 12px;
}

.upsb-launcher-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
}

.upsb-launcher-item {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    border-radius: 10px;
    transition: background 0.1s ease;
}

.upsb-launcher-item:hover {
    background: #f5f5f5;
}

.upsb-launcher-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    margin-bottom: 4px;
}

.upsb-launcher-thumb img {
    max-width: 100%;
    max-height: 100%;
}

.upsb-launcher-thumb-placeholder {
    font-size: 18px;
    font-weight: 600;
    color: #777;
}

.upsb-launcher-title {
  font-family: "Open Sans", sans-serif;
    font-size: 13px; 
    text-align: center;
    line-height: 1.25;
}

.upsb-launcher-empty {
    font-size: 13px;
    color: #666;
    grid-column: 1 / -1;
    text-align: center;
    padding: 8px 0;
}

.upsb-launcher-footer {
    margin-top: 8px;
    border-top: 1px solid #eee;
    padding-top: 6px;
    text-align: right;
}

.upsb-launcher-manage-link {
    font-size: 12px;
    text-decoration: none;
    color: #b11c24;
}

/* Manager */
.upsb-manager-intro {
    font-size: 14px;
    margin-bottom: 10px;
}

.upsb-manager-list {
    border-radius: 10px;
    border: 1px solid #eee;
    padding: 6px;
    background: #fff;
}

.upsb-manager-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    margin-bottom: 4px;
    background: #fafafa;
}

.upsb-manager-item.is-dragging {
    opacity: 0.7;
}

.upsb-manager-item.is-dragover {
    border-color: #b11c24;
}

.upsb-manager-handle {
    cursor: grab;
    margin-right: 8px;
    font-size: 16px;
    color: #999;
}

.upsb-manager-title {
    flex: 1;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.upsb-manager-remove {
    border: none;
    background: transparent;
    color: #b11c24;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 4px;
}

.upsb-loading {
    font-size: 13px;
    color: #666;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .upsb-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .upsb-launcher-panel {
        right: auto;
        left: 0;
    }
}

/* Skeleton loader */
.upsb-skeleton {
    position: relative;
    overflow: hidden;
    background: #eee;
}

.upsb-skeleton::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(238,238,238,0) 0%, rgba(255,255,255,0.8) 50%, rgba(238,238,238,0) 100%);
    animation: upsb-skeleton 1.4s infinite;
}

@keyframes upsb-skeleton {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.upsb-launcher-item-skeleton {
    cursor: default;
    background: transparent !important;
}

