/* External Media Importer - Admin Styles */

.mflk-container {
    max-width: 1200px;
}

.mflk-section {
    background: #fff;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid #ccd0d4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    border-radius: 4px;
}

.mflk-section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* File Items */
.file-item {
    padding: 12px 15px;
    border: 1px solid #ddd;
    margin: 10px 0;
    background: #f9f9f9;
    border-radius: 3px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.file-item:hover {
    background: #f0f0f0;
    border-color: #2271b1;
}

.file-item input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    transform: scale(1.1);
}

.file-item strong {
    font-size: 14px;
    color: #1d2327;
    display: block;
    margin-bottom: 5px;
}

.file-item .file-url {
    color: #666;
    font-size: 12px;
    word-break: break-all;
    font-family: Consolas, Monaco, monospace;
    padding-left: 24px;
    line-height: 1.5;
}

/* Import Controls */
.import-controls {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.import-controls .button {
    margin-right: 10px;
}

/* Progress Bar */
#import-progress {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#import-progress h3 {
    margin-top: 0;
    color: #1d2327;
    font-size: 16px;
}

.progress-bar-container {
    width: 100%;
    height: 35px;
    background: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, #2271b1, #135e96);
    transition: width 0.4s ease;
    text-align: center;
    line-height: 35px;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#progress-text {
    margin: 10px 0;
    font-size: 14px;
    font-weight: 500;
    color: #1d2327;
}

/* Import Log */
#import-log {
    margin-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    background: #fff;
    border-radius: 3px;
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
}

.log-entry {
    padding: 8px 12px;
    margin: 5px 0;
    border-left: 4px solid #ddd;
    padding-left: 12px;
    line-height: 1.6;
    border-radius: 0 3px 3px 0;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.log-entry.success {
    border-color: #46b450;
    background: #f0fff0;
    color: #155724;
}

.log-entry.error {
    border-color: #dc3232;
    background: #fff0f0;
    color: #721c24;
}

.log-entry.skipped {
    border-color: #ffb900;
    background: #fffbf0;
    color: #856404;
}

.log-entry.info {
    border-color: #72aee6;
    background: #f0f6fc;
    color: #004085;
}

.log-entry.info {
    border-color: #72aee6;
    background: #f0f6fc;
    color: #004085;
}

/* Posts Table Styles */
.posts-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.posts-table th {
    background: #f0f0f0;
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
}

.posts-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.posts-table tr:hover {
    background: #f9f9f9;
}

.post-row {
    border-bottom: 1px solid #ddd;
}

.post-header {
    background: #f8f9fa;
    font-weight: 600;
}

.file-checkbox-label {
    display: block;
    padding: 5px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.file-checkbox-label:hover {
    background: #f0f0f0;
    padding-left: 5px;
}

.external-url {
    color: #666;
    font-size: 11px;
    font-family: monospace;
    display: block;
    margin-top: 3px;
    word-break: break-all;
}

/* Already imported files */
.file-checkbox-label.file-already-imported {
    opacity: 0.6;
}

.file-checkbox-label.file-already-imported strong {
    text-decoration: line-through;
    color: #888;
}

.imported-badge {
    display: inline-block;
    background: #46b450;
    color: #fff;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: normal;
    vertical-align: middle;
}

/* Dead Link Files */
.file-checkbox-label.file-dead-link {
    opacity: 0.6;
}

.file-checkbox-label.file-dead-link strong {
    text-decoration: line-through;
    color: #888;
}

.dead-link-badge {
    display: inline-block;
    background: #dc3232;
    color: #fff;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: normal;
    vertical-align: middle;
}

/* File Size Badges (Dry Run) */
.file-size-badge {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 3px;
    margin-left: 5px;
    font-weight: normal;
    vertical-align: middle;
}

.file-size-badge.file-size-error {
    background: #dc3232;
}

#dry-run-summary {
    color: #2271b1;
    font-size: 13px;
    vertical-align: middle;
    line-height: 30px;
}

/* Resume Scan Section */
#mflk-resume-section {
    border-left: 4px solid #ffb900;
}

#mflk-resume-info {
    font-size: 14px;
    line-height: 1.6;
    color: #1d2327;
}

#mflk-resume-btn {
    margin-right: 10px;
}

/* Logs Table */
.wp-list-table .status-success {
    color: #46b450;
    font-weight: bold;
}

.wp-list-table .status-error {
    color: #dc3232;
    font-weight: bold;
}

.wp-list-table .status-skipped {
    color: #ffb900;
    font-weight: bold;
}

/* Settings Page */
.form-table th {
    width: 200px;
    padding: 20px 10px 20px 0;
}

.form-table td {
    padding: 15px 10px;
}

.form-table input[type="text"].large-text {
    width: 100%;
    max-width: 600px;
}

.form-table .description {
    margin-top: 8px;
    font-style: italic;
}

/* Select2 overrides for settings page */
.form-table .select2-container {
    width: 100% !important;
    max-width: 600px;
}

.form-table .select2-container--default .select2-selection--multiple {
    border: 1px solid #8c8f94;
    border-radius: 4px;
    min-height: 36px;
    padding: 2px 4px;
}

.form-table .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #2271b1;
    border: none;
    color: #fff;
    border-radius: 3px;
    padding: 3px 8px;
    margin: 3px 4px 3px 0;
}

.form-table .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    margin-right: 5px;
}

.form-table .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ffb900;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .mflk-section {
        padding: 15px;
    }
    
    .file-item {
        padding: 10px;
    }
    
    .import-controls .button {
        display: block;
        width: 100%;
        margin: 5px 0;
        text-align: center;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .form-table input[type="text"].large-text {
        max-width: 100%;
    }
}

/* Loading States */
.button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Scrollbar Styling for Log */
#import-log::-webkit-scrollbar {
    width: 10px;
}

#import-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

#import-log::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

#import-log::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Notice Styles */
.notice {
    margin: 15px 0;
}

/* Empty State */
#files-list:empty::before {
    content: "No files found";
    display: block;
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Dashboard Stats Grid */
.mflk-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 15px;
}

.mflk-stats-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.mflk-stat-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    border-top: 4px solid #2271b1;
}

.mflk-stat-card.stat-success {
    border-top-color: #46b450;
}

.mflk-stat-card.stat-error {
    border-top-color: #dc3232;
}

.mflk-stat-card.stat-skipped {
    border-top-color: #ffb900;
}

.mflk-stat-card.stat-info {
    border-top-color: #72aee6;
}

.mflk-stat-card .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.2;
}

.mflk-stat-card .stat-label {
    font-size: 14px;
    color: #50575e;
    margin-top: 6px;
    font-weight: 500;
}

.mflk-stat-card .stat-pct {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

.mflk-stat-card .stat-detail {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

@media screen and (max-width: 1024px) {
    .mflk-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .mflk-stats-grid,
    .mflk-stats-grid-2 {
        grid-template-columns: 1fr;
    }
}