
/* =========================================
   BLOCKS MANAGER (LIBRARY)
   ========================================= */

#blocks-manager-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
}
#blocks-manager-overlay.active { display: flex; }

#blocks-manager-window {
    width: 95%;
    max-width: 1400px;
    height: 90%;
    background: #fff;
    color: #333;
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.3);
    overflow: hidden;
}

/* Header */
.bm-header {
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    background: #fff;
}
.bm-logo-group { display: flex; align-items: center; gap: 10px; }
.bm-logo-group h2 { margin: 0; font-size: 18px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

.bm-tabs { display: flex; gap: 30px; position: absolute; left: 50%; transform: translateX(-50%); }
.bm-tab {
    padding: 15px 0;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.bm-tab:hover { color: #000; }
.bm-tab.active { color: #000; border-bottom-color: #000; }

.bm-header-actions { display: flex; gap: 15px; align-items: center; }
.btn-bm-icon { background: transparent; border: none; color: #666; cursor: pointer; transition: color 0.2s; padding: 5px; }
.btn-bm-icon:hover { color: #000; }

/* Body */
.bm-body { display: flex; flex: 1; overflow: hidden; }

/* Sidebar */
.bm-sidebar {
    width: 260px;
    background: #fff;
    border-right: 1px solid #eee;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bm-category-select-wrapper {
    position: relative;
}
.bm-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.bm-category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 10;
    display: none;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.bm-category-dropdown.active { display: block; }

.bm-category-search {
    padding: 8px;
    border-bottom: 1px solid #eee;
}
.bm-category-search input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #eee;
    font-size: 12px;
    outline: none;
    margin: 0;
}

.bm-category-item {
    padding: 10px 15px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
}
.bm-category-item:hover { background: #f5f5f5; color: #000; }
.bm-category-item.active { background: #f0f0f0; color: #000; font-weight: 500; }

.bm-favorites-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    cursor: pointer;
}
.bm-favorites-link i { font-size: 16px; color: #666; }

/* Content */
.bm-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: #fff;
}

.bm-content-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 30px;
}

.bm-search-bar {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #ddd;
    width: 250px;
}
.bm-search-bar input {
    border: none;
    padding: 8px 0;
    width: 100%;
    outline: none;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}
.bm-search-bar i { color: #999; font-size: 18px; }

/* Grid */
.bm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* Block Card */
.bm-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 1px solid #eee;
    transition: all 0.3s;
}
.bm-card:hover { border-color: #ccc; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.bm-card-preview {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f9f9f9;
    position: relative;
    overflow: hidden;
}
.bm-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s;
}
.bm-card:hover .bm-card-preview img { transform: scale(1.05); }

.bm-pro-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #8e44ad;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
}

.bm-card-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.03);
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bm-card:hover .bm-card-overlay { opacity: 1; }

.btn-bm-insert {
    background: #39b54a;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.btn-bm-insert:hover { background: #2e8b37; }

/* Custom Scrollbar */
.bm-content::-webkit-scrollbar { width: 8px; }
.bm-content::-webkit-scrollbar-track { background: #f1f1f1; }
.bm-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.bm-content::-webkit-scrollbar-thumb:hover { background: #999; }
