/**
 * Demo Import Admin Styles - Enhanced
 */

.aaima-demo-import-wrap {
    max-width: 1400px;
    padding: 20px;
}

/* Header */
.demo-import-header {
    margin-bottom: 30px;
}

.demo-import-header h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 8px;
}

.demo-import-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Filter Bar */
.demo-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 13px;
    color: #444;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    color: #fff;
    background: #2271b1;
    border-color: #2271b1;
}

/* Demos Grid */
.demos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Demo Card */
.demo-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.demo-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.demo-card.hidden {
    display: none;
}

/* Demo Preview */
.demo-preview {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.demo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.demo-card:hover .demo-preview img {
    transform: scale(1.05);
}

.demo-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-card:hover .demo-overlay {
    opacity: 1;
}

.btn-import {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-import:hover {
    background: #135e96;
    transform: scale(1.05);
}

/* Demo Info */
.demo-info {
    padding: 20px;
}

.demo-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e1e1e;
    margin: 0 0 8px;
}

.demo-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.5;
}

.demo-colors {
    display: flex;
    gap: 6px;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ============================================
   IMPORT MODAL - ENHANCED
   ============================================ */

.import-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2271b1 100%);
    color: #fff;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.demo-name-badge {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Import Steps */
.import-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.import-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 30px;
    right: 30px;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.step-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.step-icon svg {
    stroke: #999;
}

.step-icon .icon-active,
.step-icon .icon-done {
    display: none;
}

.step-label {
    font-size: 11px;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
}

/* Step States */
.step-item.active .step-icon {
    background: #fff3cd;
    animation: pulse 1.5s infinite;
}

.step-item.active .step-icon svg {
    stroke: #856404;
}

.step-item.active .step-icon .icon-pending,
.step-item.active .step-icon .icon-done {
    display: none;
}

.step-item.active .step-icon .icon-active {
    display: block;
}

.step-item.active .step-label {
    color: #856404;
}

.step-item.done .step-icon {
    background: #d4edda;
}

.step-item.done .step-icon svg {
    stroke: #155724;
}

.step-item.done .step-icon .icon-pending,
.step-item.done .step-icon .icon-active {
    display: none;
}

.step-item.done .step-icon .icon-done {
    display: block;
}

.step-item.done .step-label {
    color: #155724;
}

.step-item.error .step-icon {
    background: #f8d7da;
}

.step-item.error .step-icon svg {
    stroke: #721c24;
}

.step-item.error .step-label {
    color: #721c24;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(133, 100, 4, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(133, 100, 4, 0); }
}

/* Progress Container */
.progress-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #2271b1, #46b450);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-percent {
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
    min-width: 45px;
    text-align: right;
}

/* Current Action */
.current-action {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.action-icon {
    flex-shrink: 0;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.action-text {
    font-size: 14px;
    color: #333;
    margin: 0;
}

/* Import Log */
.import-log {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f0f0f0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.toggle-log {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

.toggle-log.expanded {
    transform: rotate(180deg);
}

.log-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 12px 16px;
    background: #1e1e1e;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.6;
}

.log-entry {
    padding: 2px 0;
    color: #ccc;
}

.log-entry .log-time {
    color: #666;
}

.log-entry .log-icon {
    margin: 0 4px;
}

.log-entry.log-success {
    color: #46b450;
}

.log-entry.log-error {
    color: #dc3232;
}

.log-entry.log-warning {
    color: #ffb900;
}

.log-entry.log-info {
    color: #00a0d2;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px 24px;
    background: #f8f9fa;
    border-top: 1px solid #ddd;
}

.btn-view-site {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #46b450;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-view-site:hover {
    background: #3a9a42;
    color: #fff;
}

.btn-close-modal {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: #f0f0f0;
}

/* Responsive */
@media (max-width: 782px) {
    .demos-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-filter-bar {
        gap: 6px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .modal-content {
        width: 100%;
        max-width: none;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .import-steps {
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
    
    .import-steps::before {
        display: none;
    }
    
    .step-item {
        flex: 0 0 calc(33.33% - 12px);
    }
}
