/* ========================================
   UNIFIED IMPORT INTERFACE STYLES
   ======================================== */

/* Source Selection Grid */
.source-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.source-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.source-card:hover {
    border-color: var(--navy);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.source-card.selected {
    border-color: var(--navy);
    background: #f7fafc;
}

.source-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.source-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.source-icon {
    font-size: 32px;
}

.source-name {
    font-weight: 600;
    font-size: 16px;
    color: #2d3748;
}

.source-description {
    font-size: 13px;
    color: #718096;
    margin-bottom: 10px;
}

.source-status {
    font-size: 12px;
    margin-top: 10px;
}

.status-loading {
    color: #ffc107;
}

.status-success {
    color: #28a745;
}

.status-error {
    color: #dc3545;
}

/* Source Selection Controls */
.source-selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.selected-count {
    font-weight: 600;
    color: var(--navy);
}

.source-control-buttons {
    display: flex;
    gap: 10px;
}

/* Global Import Settings */
.global-import-settings {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

.setting-input,
.setting-select {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.setting-input:focus,
.setting-select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(45, 55, 72, 0.1);
}

.setting-hint {
    font-size: 12px;
    color: #718096;
}

/* API-Specific Filter Panels */
.api-filters-container {
    margin-bottom: 25px;
}

.filter-panel {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f7fafc;
    cursor: pointer;
    user-select: none;
}

.filter-panel-header:hover {
    background: #edf2f7;
}

.filter-panel-title {
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-panel-toggle {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.filter-panel.collapsed .filter-panel-toggle {
    transform: rotate(-90deg);
}

.filter-panel-content {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.filter-panel.collapsed .filter-panel-content {
    display: none;
}

/* Fetch Button */
.fetch-images-button {
    width: 100%;
    padding: 20px 32px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fetch-images-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(30, 58, 138, 0.5);
    background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
}

.fetch-images-button:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.4);
}

.fetch-images-button:disabled {
    background: linear-gradient(135deg, #cbd5e0 0%, #94a3b8 100%);
    cursor: not-allowed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0.6;
}

.fetch-images-button .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Preview Section */
.unified-preview-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-title {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
}

.preview-count {
    font-size: 16px;
    color: #718096;
}

/* Bulk Selection Controls */
.bulk-selection-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.bulk-selection-controls button {
    padding: 8px 16px;
    font-size: 14px;
}

.select-by-source {
    margin-left: auto;
}

/* Preview Grid */
.unified-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.unified-image-card {
    position: relative;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.unified-image-card:hover {
    border-color: var(--navy);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.unified-image-card.selected {
    border-color: #28a745;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.unified-image-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.unified-image-card .image-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
}

.image-card-info {
    padding: 12px;
}

.image-title-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 13px;
    margin: 8px 0;
    transition: border-color 0.2s ease;
}

.image-title-input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 2px rgba(45, 55, 72, 0.1);
}

.image-title-input:hover {
    border-color: #cbd5e0;
}

.source-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.source-pexels {
    background: #05A081;
    color: white;
}

.source-pixabay {
    background: #FF6B6B;
    color: white;
}

.source-wikimedia {
    background: #339966;
    color: white;
}

.source-nasa {
    background: #667eea;
    color: white;
}

.source-nps {
    background: #56ab2f;
    color: white;
}

.source-unsplash {
    background: #434343;
    color: white;
}

.image-dimensions {
    font-size: 12px;
    color: #718096;
    margin-bottom: 4px;
}

.photographer,
.stats,
.license,
.park,
.date {
    font-size: 12px;
    color: #4a5568;
}

.archive-link {
    font-size: 11px;
    margin-top: 4px;
}

.archive-link a {
    color: #667eea;
    text-decoration: none;
}

.archive-link a:hover {
    text-decoration: underline;
}

/* Source Links */
.source-link {
    font-size: 11px;
    margin-top: 5px;
}

.source-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.source-link a:hover {
    color: #4c51bf;
    text-decoration: underline;
}

/* Import Actions */
.import-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

.import-actions-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.import-actions-right {
    display: flex;
    gap: 10px;
}

.import-selected-button {
    padding: 12px 24px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.import-selected-button:hover {
    background: #218838;
    transform: translateY(-1px);
}

.discard-button {
    padding: 12px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.discard-button:hover {
    background: #5a6268;
}

/* Progress Bar */
.import-progress {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e2e8f0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: #2d3748;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .source-selection-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .unified-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .source-selection-grid {
        grid-template-columns: 1fr;
    }
    
    .bulk-selection-controls {
        flex-direction: column;
    }
    
    .select-by-source {
        margin-left: 0;
    }
    
    .import-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .import-actions-left,
    .import-actions-right {
        width: 100%;
        flex-direction: column;
    }
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #2d3748;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Empty State */
.preview-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.preview-empty-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.preview-empty-title {
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d3748;
}

.preview-empty-description {
    font-size: 1em;
}
