/* Product Gallery Filter - Admin Styles */

/* Meta Box Styles */
.pgf-meta-box {
    padding: 10px 0;
}

.pgf-field {
    margin-bottom: 20px;
}

.pgf-field label {
    display: block;
    margin-bottom: 5px;
}

.pgf-field .description {
    margin-top: 5px;
    color: #666;
    font-style: italic;
}


/* Admin List Columns */
.column-featured_image img {
    max-width: 50px;
    height: auto;
    border-radius: 3px;
}

.column-categories a {
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
}

.column-categories a:hover {
    background: #e0e0e0;
}

/* Quick Edit Fields */
.inline-edit-row .inline-edit-col-right .pgf-quick-edit {
    clear: both;
    margin-top: 10px;
}

.inline-edit-row .inline-edit-col-right .pgf-quick-edit label {
    display: inline-block;
    width: 150px;
    margin-right: 10px;
}

.inline-edit-row .inline-edit-col-right .pgf-quick-edit input[type="text"],
.inline-edit-row .inline-edit-col-right .pgf-quick-edit input[type="url"] {
    width: 200px;
}

/* Media Upload Button */
.pgf-media-upload {
    margin-top: 10px;
}

.pgf-media-upload .button {
    margin-right: 10px;
}

.pgf-media-preview {
    margin-top: 10px;
    max-width: 150px;
}

.pgf-media-preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Loading States */
.pgf-loading {
    opacity: 0.6;
    pointer-events: none;
}

.pgf-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: pgf-spin 1s linear infinite;
}

@keyframes pgf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notices */
.pgf-notice {
    padding: 10px 15px;
    margin: 15px 0;
    border-left: 4px solid #00a0d2;
    background: #fff;
    box-shadow: 0 1px 1px rgba(0,0,0,0.04);
}

.pgf-notice-success {
    border-left-color: #46b450;
}

.pgf-notice-warning {
    border-left-color: #ffb900;
}

.pgf-notice-error {
    border-left-color: #dc3232;
}

/* Link Input Wrapper */
.pgf-link-input-wrapper {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.pgf-link-input-wrapper .pgf-link-input {
    flex-grow: 1;
}

.pgf-link-input-wrapper .pgf-link-picker {
    flex-shrink: 0;
}

/* Link Picker Modal */
.pgf-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pgf-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.pgf-modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    border-radius: 3px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 100000;
}

.pgf-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pgf-modal-header h2 {
    margin: 0;
    font-size: 1.3em;
}

.pgf-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.pgf-modal-close:hover {
    color: #000;
}

.pgf-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.pgf-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    text-align: right;
    background: #f5f5f5;
}

.pgf-search-container {
    position: relative;
}

.pgf-search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
}

.pgf-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.pgf-post-item {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.pgf-post-item:hover {
    background: #f5f5f5;
}

.pgf-post-item:last-child {
    border-bottom: none;
}

.pgf-post-item strong {
    display: block;
    margin-bottom: 5px;
}

.pgf-post-type {
    display: inline-block;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: #666;
    margin-right: 8px;
}

.pgf-post-url {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    word-break: break-all;
}

.pgf-recent-posts h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.pgf-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pgf-recent-list li {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.pgf-recent-list li:last-child {
    border-bottom: none;
}

.pgf-recent-list li:hover {
    background: #f5f5f5;
}

.pgf-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

.pgf-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

.pgf-error {
    padding: 20px;
    text-align: center;
    color: #dc3232;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .pgf-field label {
        margin-bottom: 10px;
    }

    .pgf-categories-list {
        max-height: 150px;
    }

    .column-featured_image,
    .column-categories {
        display: none;
    }
}