.awt-library-modal {
    max-width: 90vw !important;
    width: 1200px !important;
    height: 85vh !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;

    .components-modal__content {
        padding: 0 !important;
        display: flex;
        flex-direction: column;
        height: 100%;
        margin-top: 10px;
    }

    .components-modal__header {
        display: none; // ডিফল্ট হেডার অফ করে দিচ্ছি
    }
}

/* --- Header --- */
.awt-library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;

    .awt-header-left {
        display: flex;
        align-items: center;
        gap: 30px;

        .awt-brand {
            margin: 0;
            font-size: 18px;
            font-weight: 700;
            color: #2271b1;
        }

        .awt-tabs {
            display: flex;
            background: #f0f0f1;
            padding: 4px;
            border-radius: 6px;

            .awt-tab {
                background: transparent;
                border: none;
                padding: 6px 16px;
                font-size: 13px;
                font-weight: 500;
                cursor: pointer;
                border-radius: 4px;
                transition: all 0.2s;

                &.active {
                    background: #fff;
                    color: #2271b1;
                    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
                }
            }
        }
    }

    .awt-header-right {
        display: flex;
        align-items: center;
        gap: 15px;

        .awt-search-wrapper {
            position: relative;

            input {
                padding-left: 32px;
                height: 36px;
                border-radius: 4px;
                border: 1px solid #ddd;
                min-width: 250px;
            }

            svg {
                position: absolute;
                left: 8px;
                top: 50%;
                transform: translateY(-50%);
                fill: #999;
                width: 18px;
            }
        }
    }
}

/* --- Body --- */
.awt-library-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8f9fa;
}

/* Sidebar */
.awt-library-sidebar {
    width: 220px;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    padding: 20px;
    overflow-y: auto;

    h3 {
        font-size: 12px;
        text-transform: uppercase;
        color: #757575;
        margin-bottom: 15px;
        letter-spacing: 0.5px;
    }

    ul {
        list-style: none;
        margin: 0;
        padding: 0;

        li {
            margin-bottom: 5px;

            button {
                width: 100%;
                text-align: left;
                background: none;
                border: none;
                padding: 8px 12px;
                border-radius: 4px;
                cursor: pointer;
                font-size: 14px;
                color: #333;
                transition: background 0.2s;

                &:hover {
                    background: #f0f0f1;
                }

                &.active {
                    background: #e6f0ff;
                    color: #2271b1;
                    font-weight: 500;
                }
            }
        }
    }
}

/* Content Grid */
.awt-library-content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;

    .awt-template-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }

    .awt-template-card {
        background: #fff;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #e0e0e0;
        transition: transform 0.2s, box-shadow 0.2s;


        .awt-card-preview {
            height: auto;
            background: #f0f0f1;
            position: relative;
            display: flex;
            align-items: flex-start;
            /* Changed from center to accommodate top alignment */
            justify-content: center;
            overflow: hidden;
            /* Ensure overflow is hidden */

            img.awt-pattern-img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                object-position: top center;
                transition: transform 0.3s ease;
                /* Default transition */
            }

            /* Full Page Specific Styles */
            &.is-full-page {
                height: 350px;
                /* Taller container */

                img.awt-pattern-img {
                    height: auto;
                    min-height: 100%;
                    transition: transform 2.5s ease-in-out;
                    /* Smooth scroll */
                }

                &:hover {
                    img.awt-pattern-img {
                        transform: translateY(calc(-100% + 350px));
                        /* Scroll to bottom */
                    }
                }
            }

            .placeholder-preview {
                font-size: 60px;
                color: #cbd5e1;
                font-weight: 700;
                align-self: center;
                /* Center placeholder if image fails */
            }

            .awt-card-overlay {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: rgba(255, 255, 255, 0.9);
                display: flex;
                align-items: center;
                justify-content: center;
                opacity: 0;
                transition: opacity 0.2s;
                z-index: 2;
                /* Ensure overlay is above image */
            }

        }

        &:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
            border-color: #2271b1;

            .awt-card-overlay {
                opacity: 1;
                background-color: rgba(255, 255, 255, 0);
            }
        }

        .awt-card-footer {
            padding: 12px 15px;
            border-top: 1px solid #f0f0f1;
            display: flex;
            justify-content: space-between;
            align-items: center;

            h4 {
                margin: 0;
                font-size: 14px;
                color: #333;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                flex: 1;
                margin-right: 10px;
            }

            .awt-badge {
                background: #e6f0ff;
                color: #2271b1;
                font-size: 10px;
                font-weight: 600;
                padding: 2px 6px;
                border-radius: 4px;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }
        }
    }
}

.awt-empty-state {
    text-align: center;
    padding: 50px;
    color: #757575;
    font-size: 16px;
}