/* ACF Lucide Icon Field Styles */

/* Prevent body scrolling when modal is open */
body.acf-lucide-modal-open {
    overflow: hidden;
}

.acf-lucide-icon-field {
    position: relative;
}

.lucide-icon-selector {
    position: relative;
}

/* Selected Icon Preview */
.selected-icon-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.icon-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 120px;
}

.icon-preview i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 18px;
}

.icon-preview i svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.icon-name {
    font-family: monospace;
    font-size: 13px;
    color: #666;
}

.no-icon-selected {
    color: #999;
    font-style: italic;
}

.select-icon-btn,
.remove-icon-btn {
    font-size: 13px !important;
    padding: 8px 15px !important;
    height: auto !important;
}

.remove-icon-btn {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.remove-icon-btn:hover {
    background: #c82333 !important;
    border-color: #c82333 !important;
}

/* Modal Styles */
.icon-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden; /* Prevent background scrolling */
}

.icon-picker-modal > div {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Search and close container at top */
.icon-search-container {
    position: sticky;
    top: 0;
    background: white;
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid #eee;
    border-radius: 12px 12px 0 0;
    z-index: 10;
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-search {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.icon-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.close-modal {
    background: #f0f0f0;
    border: 1px solid #ddd;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-modal:hover {
    background: #e0e0e0;
    color: #333;
    border-color: #ccc;
}

/* Icon Categories */
.icon-categories {
    overflow-y: auto;
    padding: 0;
    max-height: calc(90vh - 20px);
    padding-bottom: 20px;
}

/* Custom scrollbar styling */
.icon-categories::-webkit-scrollbar {
    width: 8px;
}

.icon-categories::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.icon-categories::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.icon-categories::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.icon-category {
    margin-bottom: 30px;
    padding: 0 20px;
}

.icon-category:first-child {
    padding-top: 0;
}

.icon-category h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Icons Grid */
.icons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    text-align: center;
}

.icon-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.icon-option i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 16px;
}

.icon-option i svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.icon-label {
    font-size: 11px;
    color: #666;
    line-height: 1.2;
    word-break: break-word;
}

.icon-option:hover .icon-label {
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .icon-picker-modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }

    .icon-picker-modal > div {
        width: 100%;
        max-height: 95vh;
        margin: 0;
    }

    .icon-picker-header {
        padding: 15px;
    }

    .close-modal {
        top: 10px;
        right: 15px;
    }

    .icon-search-container {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }

    .icon-categories {
        padding-bottom: 15px;
    }

    .icon-category {
        padding: 0 15px;
    }

    .icons-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }

    .icon-option {
        padding: 10px 6px;
    }

    .icon-option i {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .icon-option i svg {
        width: 16px;
        height: 16px;
    }

    .selected-icon-preview {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

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

@media (max-width: 480px) {
    .icon-picker-modal {
        padding: 5px;
        padding-top: 10px;
    }

    .icon-picker-modal > div {
        max-height: 98vh;
    }

    .icon-picker-header {
        padding: 10px;
    }

    .icon-categories {
        padding-bottom: 10px;
    }

    .icon-category {
        padding: 0 10px;
    }

    .icons-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 6px;
    }

    .icon-option {
        padding: 8px 4px;
    }

    .icon-option i {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .icon-option i svg {
        width: 14px;
        height: 14px;
    }

    .icon-label {
        font-size: 10px;
    }
}