/* Main container styles */
.digiblocks-font-awesome-control {
    position: relative;
    margin-bottom: 24px;
}

/* Control label styling */
.digiblocks-font-awesome-control .digiblocks-control-label {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    text-transform: uppercase;
    box-sizing: border-box;
    display: block;
    margin-bottom: .5rem;
}

/* Icon placeholder wrapper - the selector button */
.digiblocks-ip-placeholder-wrap {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f0f0f1;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.digiblocks-ip-placeholder-wrap:hover {
    background: #f6f7f7;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* Selected icon container */
.digiblocks-ip-selected-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    margin-right: 10px;
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Icon placeholder SVG sizing */
.digiblocks-ip-selected-icon-value {
    &,
	span {
		display: flex;
	}
}

.digiblocks-ip-selected-icon {
    display: flex;

	svg {
		width: 24px;
		height: 24px;
		color: #3c434a;
	}
}

/* Remove icon button */
.digiblocks-ip-remove-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #cc1818;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
    z-index: 10;
}

.digiblocks-ip-placeholder-wrap:hover .digiblocks-ip-remove-icon {
    opacity: 1;
    transform: scale(1);
}

.digiblocks-ip-remove-icon svg {
    width: 12px;
    height: 12px;
    fill: #ffffff;
}

/* Action label */
.digiblocks-ip-actions {
    flex: 1;
    font-size: 13px;
    color: #3c434a;
}

.digiblocks-ip-actions span {
    display: inline-block;
    transition: color 0.2s ease;
}

.digiblocks-ip-placeholder-wrap:hover .digiblocks-ip-actions span {
    color: #007cba;
}

/* 
 * Modal styles 
 */

/* Modal overlay */
.digiblocks-ip-modal-wrapper-overlay {
    background: rgba(0, 0, 0, 0.7) !important;
    z-index: 160000 !important;
    animation: modal-appear 0.2s ease-out;
}

@keyframes modal-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal container */
.digiblocks-ip-modal-wrapper {
    max-width: 900px !important;
    width: 90% !important;
    height: 600px !important;
    max-height: 80vh !important;
    padding: 0 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
    animation: modal-slide-up 0.25s ease-out;

	.components-modal__header {
		display: none;
	}

	.components-modal__content {
		margin: 0;
		padding: 0;

		&.has-scrolled-content:not(.hide-header) .components-modal__header {
			border: 0;
		}
	}
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal header */
.digiblocks-ip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
	gap: 2rem;
    padding: 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid #dcdcde;
}

.digiblocks-ip-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
}

/* Search container */
.digiblocks-ip-search-container {
    flex: 1;

	.components-base-control {
		width: 100%;
	}
}

.digiblocks-ip-search-bar {
    position: relative;
    display: flex;
    align-items: center;
}

.digiblocks-ip-search-bar svg {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    fill: #757575;
}

.digiblocks-ip-search-bar input.components-text-control__input {
    padding-left: 32px !important;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #dcdcde;
    width: 100%;
}

.digiblocks-ip-search-bar input.components-text-control__input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* Clear search button */
.digiblocks-ip-search-bar span {
    position: absolute;
    right: 10px;
    font-size: 18px;
    font-weight: bold;
    color: #757575;
    cursor: pointer;
    transition: color 0.2s ease;
}

.digiblocks-ip-search-bar span:hover {
    color: #cc1818;
}

/* Main content area - left/right layout */
.digiblocks-ip-lr-container {
    display: flex;
    height: calc(100% - 130px); /* Accounting for header and footer */
    overflow: hidden;
}

/* Left sidebar */
.digiblocks-ip-left {
    width: 220px;
    background: #f6f7f7;
    border-right: 1px solid #dcdcde;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Categories list */
.digiblocks-ip-categories-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.digiblocks-ip-categories-list div {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    color: #3c434a;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.digiblocks-ip-categories-list div:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #007cba;
}

.digiblocks-ip-categories-list div.selected {
    background: #f0f6fc;
    color: #007cba;
    border-left-color: #007cba;
    font-weight: 500;
}

/* Style selector area */
.digiblocks-ip-style-selector {
    padding: 16px;
    border-top: 1px solid #dcdcde;
    background: #f0f0f1;
}

.digiblocks-ip-style-selector .components-base-control__label {
    margin-bottom: 8px;
    font-weight: 500;
}

.digiblocks-ip-style-selector .components-select-control__input {
    height: 36px;
}

/* Right content area */
.digiblocks-ip-right {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.digiblocks-ip-modal-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #ffffff;
}

/* Loading state */
.digiblocks-ip-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #3c434a;
}

.digiblocks-ip-loading .components-spinner {
    margin: 0 0 12px 0;
}

/* Icons grid */
.digiblocks-ip-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    padding-bottom: 16px;
}

/* Empty state */
.digiblocks-ip-icons.icon-not-found {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 14px;
    color: #757575;
}

/* Individual icon item */
.digiblocks-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 90px;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    border: 1px solid transparent;
}

.digiblocks-icon-item:hover {
    background: #f6f7f7;
    border-color: #dcdcde;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.digiblocks-icon-item.selected {
    background: #f0f6fc;
    border-color: #007cba;
}

.digiblocks-icon-item svg {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
    color: #3c434a;
}

.digiblocks-icon-item span:nth-child(2) {
    font-size: 11px;
    color: #757575;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    max-width: 100%;
}

/* Load more button */
.digiblocks-ip-load-more {
    display: block !important;
    grid-column: 1 / -1;
    margin: 16px auto 0 !important;
}

/* Modal footer */
.digiblocks-ip-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
}

.digiblocks-ip-footer button {
	justify-content: center;
    min-width: 80px;
}

/* Responsive adjustments */
@media (max-width: 782px) {
    .digiblocks-ip-modal-wrapper {
        width: 95% !important;
        height: 90vh !important;
        max-height: none !important;
    }
    
    .digiblocks-ip-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .digiblocks-ip-search-container {
        width: 100%;
        max-width: none;
        margin: 16px 0 0;
    }
    
    .digiblocks-ip-lr-container {
        flex-direction: column;
        height: calc(100% - 180px);
    }
    
    .digiblocks-ip-left {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #dcdcde;
    }
    
    .digiblocks-ip-categories-list {
        display: flex;
        overflow-x: auto;
        padding: 8px;
    }
    
    .digiblocks-ip-categories-list div {
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 8px 12px;
    }
    
    .digiblocks-ip-categories-list div.selected {
        border-left-color: transparent;
        border-bottom-color: #007cba;
    }
    
    .digiblocks-ip-icons {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .digiblocks-icon-item {
        height: 80px;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.digiblocks-ip-modal-wrapper {
    animation: fadeIn 0.2s ease-out;
}

.digiblocks-icon-item {
    animation: fadeIn 0.3s ease-out;
}

/* Icon Box Block Styles */
.digiblocks-icon-box {
    position: relative;
    transition: all 0.3s ease;
}

/* Hover effects */
.digiblocks-icon-box[data-hover-effect="lift"]:hover {
    transform: translateY(-10px);
}

.digiblocks-icon-box[data-hover-effect="scale"]:hover {
    transform: scale(1.05);
}

.digiblocks-icon-box[data-hover-effect="glow"]:hover {
    box-shadow: 0 0 20px rgba(0, 120, 215, 0.2);
}

/* Animation styles */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(30px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.digiblocks-icon-box[data-animation="fade-in"] {
    animation: fadeIn 1s ease;
}

.digiblocks-icon-box[data-animation="slide-up"] {
    animation: slideInUp 1s ease;
}

.digiblocks-icon-box[data-animation="slide-left"] {
    animation: slideInLeft 1s ease;
}

.digiblocks-icon-box[data-animation="slide-right"] {
    animation: slideInRight 1s ease;
}

.digiblocks-icon-box[data-animation="zoom-in"] {
    animation: zoomIn 1s ease;
}

.digiblocks-icon-box[data-animation="bounce"] {
    animation: bounce 1s ease;
}