/**
 * 🎨 EML TEMPLATE LOADER STYLES
 * Style dla importera szablonów EML
 */

/* EML Import Controls */
.eml-import-controls {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.eml-import-controls h4 {
    color: white;
    font-weight: 600;
}

.eml-import-controls p {
    color: rgba(255, 255, 255, 0.9) !important;
}

.eml-import-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.eml-import-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

/* EML Import Modal */
.eml-import-modal {
    max-width: 800px;
    margin: 0 auto;
}

.import-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
}

.import-header h3 {
    color: #333;
    margin-bottom: 8px;
    font-size: 24px;
}

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

.import-basic-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.import-structure {
    margin-bottom: 20px;
}

.import-structure h4 {
    color: #495057;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.elements-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.element-preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 5px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.element-preview-item:hover {
    background: #e3f2fd;
}

.element-icon {
    font-size: 16px;
    margin-right: 8px;
}

.element-name {
    flex: 1;
    font-size: 14px;
    color: #495057;
}

.element-index {
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
}

.import-options {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
}

.import-options h4 {
    color: #856404;
    margin-bottom: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.import-metadata {
    margin-bottom: 25px;
}

.import-metadata details {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
}

.import-metadata summary {
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    padding: 5px;
}

.import-metadata summary:hover {
    color: #007bff;
}

.import-metadata pre {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
    white-space: pre-wrap;
    margin-top: 10px;
}

.import-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.import-actions button {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* File Input Styling */
#eml-file-input {
    display: none;
}

/* Success States */
.eml-import-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.eml-import-success::before {
    content: "✅ ";
    font-weight: bold;
}

/* Error States */
.eml-import-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.eml-import-error::before {
    content: "❌ ";
    font-weight: bold;
}

/* Loading States */
.eml-import-loading {
    background: #cce7ff;
    border: 1px solid #b3d9ff;
    color: #004085;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    position: relative;
}

.eml-import-loading::before {
    content: "⏳ ";
    font-weight: bold;
}

.eml-import-loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #004085;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .eml-import-modal {
        padding: 15px;
    }

    .import-actions {
        flex-direction: column;
    }

    .import-actions button {
        width: 100%;
    }

    .elements-preview {
        max-height: 150px;
    }

    .element-preview-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Integration with existing styles */
.complete-email-container .eml-import-section {
    margin-bottom: 20px;
}

/* Template list integration */
#templates-list .template-item.eml-imported {
    border-left: 4px solid #17a2b8;
    background: linear-gradient(90deg, rgba(23, 162, 184, 0.1) 0%, transparent 100%);
}

#templates-list .template-item.eml-imported .complete-item-badge::after {
    content: "📧 EML";
    background: #17a2b8;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* Joanna Krupa specific styling */
.template-item.joanna-krupa {
    border-left: 4px solid #ff6b6b;
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.1) 0%, transparent 100%);
}

.template-item.joanna-krupa .complete-item-title::before {
    content: "🌟 ";
}

.template-item.joanna-krupa .complete-item-badge::after {
    content: "JOANNA";
    background: #ff6b6b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
    font-weight: bold;
}