/* Blocks Library Styles */

.blocks-sidebar {
    width: 100%;
    padding: 20px;
    background: #f8f9fa;
}

.blocks-header {
    margin-bottom: 20px;
}

.blocks-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 10px;
}

.block-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #4a5568;
}

.block-counter.warning {
    background: #fef3c7;
    color: #92400e;
}

.block-counter.limit-reached {
    background: #fee2e2;
    color: #991b1b;
}

.block-counter i {
    font-size: 14px;
}

.blocks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.block-category {
    margin-bottom: 20px;
}

.block-category-title {
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.block-item {
    padding: 15px 10px;
    background: white;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    cursor: grab;
    text-align: center;
    transition: all 0.2s;
    user-select: none;
}

.block-item:hover {
    background: #edf2f7;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.block-item:active {
    cursor: grabbing;
}

.block-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.block-item i {
    font-size: 24px;
    color: #3b82f6;
    margin-bottom: 6px;
    display: block;
}

.block-item span {
    font-size: 12px;
    color: #4a5568;
    font-weight: 500;
}

/* Drop Zone Styles */
.theme-drop-zone {
    height: 10px;
    margin: 5px 0;
    background-color: transparent;
    border: 2px dashed transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: none;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.theme-drop-zone.active {
    height: 60px !important;
    background-color: rgba(59, 130, 246, 0.05) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    animation: dropzone-pulse 2s infinite;
}

.theme-drop-zone.drag-over {
    height: 80px !important;
    background-color: rgba(59, 130, 246, 0.15) !important;
    border-color: #3b82f6 !important;
}

.theme-drop-zone .dz-text {
    display: none;
    color: #3b82f6;
    font-weight: 600;
    font-size: 14px;
    pointer-events: none !important;
}

.theme-drop-zone.active .dz-text {
    display: block;
}

@keyframes dropzone-pulse {
    0% {
        background-color: rgba(59, 130, 246, 0.05);
    }

    50% {
        background-color: rgba(59, 130, 246, 0.15);
    }

    100% {
        background-color: rgba(59, 130, 246, 0.05);
    }
}

/* Custom Block Styles */
.custom-block {
    position: relative;
    padding: 15px;
    margin: 10px;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
    cursor: pointer;
}

.custom-block:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-block.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Block Typography Resets */
.theme-custom-block h1 {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
    line-height: 1.2 !important;
    color: inherit;
}

.theme-custom-block h2 {
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.8rem !important;
    line-height: 1.2 !important;
    color: inherit;
}

.theme-custom-block h3 {
    font-size: 1.75rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.8rem !important;
    line-height: 1.2 !important;
    color: inherit;
}

.theme-custom-block h4 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.2 !important;
    color: inherit;
}

.theme-custom-block p {
    font-size: 1.1rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
    color: inherit;
}

.theme-custom-block button {
    font-size: 1rem !important;
    font-weight: 600 !important;
}

/* Block Toolbar */
.block-toolbar {
    position: absolute;
    top: -35px;
    right: 0;
    display: none;
    gap: 4px;
    background: white;
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.custom-block:hover .block-toolbar,
.custom-block.selected .block-toolbar {
    display: flex;
}

.block-toolbar button {
    width: 28px;
    height: 28px;
    border: none;
    background: #f7fafc;
    color: #4a5568;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.block-toolbar button:hover {
    background: #edf2f7;
    color: #2d3748;
}

.block-toolbar button.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

.block-toolbar button i {
    font-size: 12px;
}

/* Grid System */
.blocks-row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
    padding: 10px;
}

[class*="col-"] {
    padding: 10px;
    box-sizing: border-box;
}

.col-1 {
    width: 8.33%;
}

.col-2 {
    width: 16.66%;
}

.col-3 {
    width: 25%;
}

.col-4 {
    width: 33.33%;
}

.col-5 {
    width: 41.66%;
}

.col-6 {
    width: 50%;
}

.col-7 {
    width: 58.33%;
}

.col-8 {
    width: 66.66%;
}

.col-9 {
    width: 75%;
}

.col-10 {
    width: 83.33%;
}

.col-11 {
    width: 91.66%;
}

.col-12 {
    width: 100%;
}

/* Responsive Grid */
@media (max-width: 768px) {
    [class*="col-"] {
        width: 100% !important;
    }
}

/* Slot-Based Layout System */
.theme-layout-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.theme-layout-main-flex {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 20px;
    align-items: flex-start;
}

.theme-layout-content {
    flex: 1;
    min-width: 0;
}

.theme-slot {
    min-height: 40px;
}

.theme-slot-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.theme-slot-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

@media (max-width: 992px) {
    .theme-layout-main-flex {
        flex-direction: column;
    }

    .theme-slot-sidebar {
        width: 100%;
    }
}