/* Media Title & ALT Editor Styles */

.peiwm-media-alt-editor {
    margin-top: 1rem;
}

.peiwm-editor-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background: #fff;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.peiwm-editor-filters {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 1;
}

.peiwm-search-input {
    min-width: 240px;
    padding: 6px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
}

.peiwm-filter-select {
    padding: 6px 12px !important;
    border: 1px solid #d1d5db !important;
    border-radius: 6px !important;
    font-size: 0.875rem !important;
    background-color: #fff;
}

.peiwm-edit-mode-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f9fafb;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.peiwm-edit-mode-group label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    margin: 0;
}

.peiwm-editor-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.peiwm-media-list {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.peiwm-media-table {
    width: 100%;
    border-collapse: collapse;
}

.peiwm-media-table th,
.peiwm-media-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.peiwm-media-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
}

.peiwm-media-table tbody tr:last-child td {
    border-bottom: none;
}

.peiwm-media-table tbody tr:hover {
    background-color: #f9fafb;
}

.peiwm-media-table tr.peiwm-changed {
    background-color: #fefce8;
}

.peiwm-media-table tr.peiwm-changed:hover {
    background-color: #fef08a;
}

.peiwm-media-thumb {
    width: 75px;
    height: 75px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.peiwm-thumb-cell a:hover .peiwm-media-thumb {
    border-color: #2563eb;
    transform: scale(1.04);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.15);
}

.peiwm-media-edit-link:hover {
    text-decoration: underline !important;
    color: #1d4ed8 !important;
}

.peiwm-media-table input[type="text"] {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.peiwm-media-table input[type="text"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.peiwm-media-table input[type="text"].peiwm-input-changed {
    border-color: #eab308;
    background-color: #fffde7;
}

.peiwm-editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.peiwm-media-count {
    font-size: 0.875rem;
    color: #6b7280;
}

.peiwm-editor-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Loading Overlay */
.peiwm-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.peiwm-loading-content {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.peiwm-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: peiwm-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes peiwm-spin {
    to {
        transform: rotate(360deg);
    }
}