/* ACF Icon Field Styles */

.acf-icon-field {
    padding: 15px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

/* Tabs */
.acf-icon-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e5e5;
}

.acf-icon-tab {
    padding: 12px 20px;
    background: #f6f7f7;
    border: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #646970;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.acf-icon-tab:hover {
    background: #fff;
    color: #2271b1;
}

.acf-icon-tab[data-active="true"] {
    background: #2271b1;
    color: #fff;
}

.acf-icon-tab .dashicons {
    font-size: 16px;
}

/* Panels */
.acf-icon-panel {
    display: none;
}

.acf-icon-panel[data-active="true"] {
    display: block;
}

/* Library Selector */
.acf-icon-library-selector {
    margin-bottom: 15px;
}

.acf-icon-library-selector label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.acf-icon-library-select {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

/* Search */
.acf-icon-search {
    position: relative;
    margin-bottom: 15px;
}

.acf-icon-search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
}

.acf-icon-search .dashicons {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #646970;
}

/* Icon Grid */
.acf-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background: #f9f9f9;
}

.acf-icon-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #fff;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 70px;
}

.acf-icon-grid-item:hover {
    border-color: #2271b1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.acf-icon-grid-item[data-selected="true"] {
    border-color: #2271b1;
    background: #f0f6fc;
}

.acf-icon-grid-item i,
.acf-icon-grid-item span {
    font-size: 24px;
    color: #1e1e1e;
}

.acf-icon-grid-item-name {
    margin-top: 5px;
    font-size: 10px;
    text-align: center;
    color: #646970;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

/* Loading State */
.acf-icon-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.acf-icon-grid[data-loading="false"] .acf-icon-loading {
    display: none;
}

/* Upload Area */
.acf-icon-upload-area {
    padding: 40px;
    text-align: center;
    border: 2px dashed #c3c4c7;
    border-radius: 8px;
    background: #f9f9f9;
}

.acf-icon-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    font-size: 16px;
}

.acf-icon-upload-btn .dashicons {
    font-size: 24px;
}

.acf-icon-uploaded {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.acf-icon-uploaded img {
    max-width: 100px;
    max-height: 100px;
    display: block;
    margin: 0 auto 15px;
}

/* AI Generator */
.acf-icon-ai-generator {
    padding: 20px;
}

.acf-icon-ai-generator label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.acf-icon-ai-prompt {
    width: 100%;
    padding: 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.acf-icon-ai-options {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.acf-icon-ai-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

.acf-icon-ai-generate {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.acf-icon-ai-result {
    margin-top: 20px;
    padding: 20px;
    background: #f0f6fc;
    border: 1px solid #2271b1;
    border-radius: 8px;
}

.acf-icon-ai-result h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.acf-icon-ai-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #fff;
    border-radius: 4px;
    margin-bottom: 15px;
}

.acf-icon-ai-preview svg {
    width: 100px;
    height: 100px;
}

/* Selected Icon Preview */
.acf-icon-preview {
    margin-top: 20px;
    padding: 15px;
    background: #f0f6fc;
    border: 2px solid #2271b1;
    border-radius: 8px;
    display: none;
}

.acf-icon-preview[data-has-icon="true"] {
    display: block;
}

.acf-icon-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.acf-icon-preview-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: #fff;
    border-radius: 4px;
}

.acf-icon-preview-display i,
.acf-icon-preview-display svg,
.acf-icon-preview-display img {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

/* Icon Styling Options */
.acf-icon-styling {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.acf-icon-styling h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.acf-icon-style-row {
    margin-bottom: 15px;
}

.acf-icon-style-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.acf-icon-size-select,
.acf-icon-color-picker {
    width: 100%;
    max-width: 200px;
    padding: 8px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

.acf-icon-use-theme-css {
    margin-right: 5px;
}

/* Empty State */
.acf-icon-empty {
    color: #646970;
    font-style: italic;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .acf-icon-tabs {
        flex-direction: column;
    }
    
    .acf-icon-tab {
        border-radius: 4px;
    }
    
    .acf-icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .acf-icon-ai-options {
        flex-direction: column;
        gap: 10px;
    }
}

/* Color Picker Integration */
.acf-icon-color-picker {
    cursor: pointer;
}

/* Animation */
@keyframes icon-select {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.acf-icon-grid-item[data-selected="true"] {
    animation: icon-select 0.3s ease;
}
