/**
 * Editor styles for Image Sources Manager
 *
 * @package Image_Sources_Manager
 */

/* Image card styles */
.eiam-image-card {
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.eiam-image-card .components-card__header {
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 12px 16px;
}

.eiam-image-card .components-card__body {
    padding: 16px;
}

.eiam-image-card .components-card__media {
    margin-right: 12px;
}

.eiam-image-card .components-card__media img {
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.eiam-image-card .eiam-status {
    margin-top: 4px;
}

.eiam-image-card .eiam-complete {
    color: #00a32a;
    font-size: 12px;
    font-weight: 500;
}

.eiam-image-card .eiam-incomplete {
    color: #d63638;
    font-size: 12px;
    font-weight: 500;
}

/* Form controls */
.eiam-image-card .components-base-control {
    margin-bottom: 16px;
}

.eiam-image-card .components-base-control:last-child {
    margin-bottom: 0;
}

.eiam-image-card .components-base-control__label {
    font-weight: 500;
    margin-bottom: 4px;
}

.eiam-image-card .components-text-control__input,
.eiam-image-card .components-textarea-control__input {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
}

.eiam-image-card .components-text-control__input:focus,
.eiam-image-card .components-textarea-control__input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}

/* Button styles */
.eiam-image-card .components-button {
    margin-right: 8px;
}

.eiam-image-card .components-button:last-child {
    margin-right: 0;
}

.eiam-image-card .components-button.is-primary {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.eiam-image-card .components-button.is-primary:hover {
    background: #005a87;
    border-color: #005a87;
}

.eiam-image-card .components-button.is-primary:disabled {
    background: #c3c4c7;
    border-color: #c3c4c7;
    color: #a7aaad;
}

.eiam-image-card .components-button.is-secondary {
    background: #f6f7f7;
    border-color: #c3c4c7;
    color: #2c3338;
}

.eiam-image-card .components-button.is-secondary:hover {
    background: #f0f0f1;
    border-color: #8c8f94;
}

.eiam-image-card .components-button.is-secondary:disabled {
    background: #f6f7f7;
    border-color: #c3c4c7;
    color: #a7aaad;
}

/* Loading spinner */
.eiam-image-card .components-spinner {
    margin-right: 8px;
}

/* Images list */
.eiam-images-list {
    max-height: 400px;
    overflow-y: auto;
}

.eiam-images-list::-webkit-scrollbar {
    width: 6px;
}

.eiam-images-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.eiam-images-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.eiam-images-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Panel body */
.eiam-image-sources .components-panel__body {
    border-top: 1px solid #e0e0e0;
}

.eiam-image-sources .components-panel__body:first-child {
    border-top: none;
}

/* Notice styles */
.eiam-image-sources .components-notice {
    margin: 0 0 16px 0;
}

.eiam-image-sources .components-notice.is-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    color: #d63638;
}

/* Empty state */
.eiam-image-sources .components-panel__body p {
    color: #646970;
    font-style: italic;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Loading state */
.eiam-image-sources .components-panel__row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.eiam-image-sources .components-panel__row span {
    color: #646970;
}

/* Responsive */
@media (max-width: 600px) {
    .eiam-image-card .components-card__header {
        padding: 8px 12px;
    }
    
    .eiam-image-card .components-card__body {
        padding: 12px;
    }
    
    .eiam-image-card .components-base-control {
        margin-bottom: 12px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .eiam-image-card {
        border-color: #3c434a;
        background: #1e1e1e;
    }
    
    .eiam-image-card .components-card__header {
        background: #2c3338;
        border-bottom-color: #3c434a;
    }
    
    .eiam-image-card .components-text-control__input,
    .eiam-image-card .components-textarea-control__input {
        background: #2c3338;
        border-color: #3c434a;
        color: #f0f0f1;
    }
    
    .eiam-image-card .components-text-control__input:focus,
    .eiam-image-card .components-textarea-control__input:focus {
        border-color: #007cba;
        box-shadow: 0 0 0 1px #007cba;
    }
}

/* Block preview styles */
.eiam-block-preview {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 16px;
    background: #f8f9fa;
    margin: 8px 0;
}

.eiam-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.eiam-preview-scope {
    font-size: 12px;
    color: #646970;
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
}

.eiam-preview-content {
    /* Preview content */
}

.eiam-preview-text {
    margin: 0 0 8px 0;
    color: #646970;
    font-style: italic;
}

.eiam-preview-attributes {
    font-size: 11px;
    color: #8c8f94;
}

.eiam-show-missing {
    color: #d63638;
}

/* Table preview styles */
.eiam-preview-table {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    margin: 8px 0;
}

.eiam-preview-table-header {
    display: grid;
    grid-template-columns: 60px 1fr 100px 100px 80px;
    gap: 8px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.eiam-preview-table-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px 100px 80px;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    color: #555;
}

.eiam-preview-table-row:last-child {
    border-bottom: none;
}

.eiam-preview-table-row span:first-child {
    text-align: center;
    font-size: 16px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .eiam-image-card {
        border-width: 2px;
    }
    
    .eiam-image-card .eiam-complete,
    .eiam-image-card .eiam-incomplete {
        font-weight: bold;
        text-decoration: underline;
    }
    
    .eiam-image-card .components-button {
        border-width: 2px;
    }
    
    .eiam-block-preview {
        border-width: 2px;
    }
    
    .eiam-preview-table {
        border-width: 2px;
    }
}
