/**
 * QuantumLayers Merged Datasets UI - Styles
 * File: assets/merge-datasets.css
 */

/* ========================================
   Merge Datasets Container
   ======================================== */

#merge-datasets-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.merge-section {
    background: #fff;
    border-radius: 2px;
    padding: 30px;
    margin-bottom: 30px;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.merge-section h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

/* ========================================
   Form Elements
   ======================================== */

#merge-name {
    width: 100%;
    max-width: 500px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 2px;
    margin-bottom: 20px;
    color: #333;
}

#merge-name:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

/* ========================================
   Dataset List
   ======================================== */

#loading-datasets {
    text-align: center;
    padding: 40px;
    color: #666;
}

#datasets-list {
    margin-top: 20px;
}

.no-datasets {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.dataset-item {
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 15px;
    margin-bottom: 15px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.dataset-item:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.dataset-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 15px;
}

.dataset-checkbox {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.dataset-name {
    font-weight: 600;
    color: #333;
    margin-right: 10px;
}

.dataset-meta {
    color: #666;
    font-size: 13px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 2px;
    margin-left: 10px;
}

.badge-primary {
    background: #0073aa;
    color: #fff;
}

/* ========================================
   Join Configuration
   ======================================== */

.join-config {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.join-config-inner {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.join-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.join-column-select,
.join-type-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-size: 14px;
    min-width: 200px;
    background: #fff;
}

.join-column-select:focus,
.join-type-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.1);
}

/* ========================================
   Buttons
   ======================================== */

.button-primary {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.button-primary:disabled,
.button-primary.disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-secondary {
    background: #fff;
    color: #0073aa;
    border: 1px solid #0073aa;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-secondary:hover {
    background: #f0f8ff;
}

/* ========================================
   Merged Datasets Table
   ======================================== */

.merged-datasets-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.merged-datasets-table th {
    background: #f5f5f5;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.merged-datasets-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.merged-datasets-table tr:hover {
    background: #fafafa;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
}

.status-ready {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================
   Merge Config Modal
   ======================================== */

.merge-config-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 30px;
    border-radius: 2px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.merge-config-modal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: -1;
}

.merge-config-modal h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.merge-flow {
    margin: 20px 0;
}

.merge-step {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 2px;
    margin-bottom: 10px;
}

.merge-dataset {
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 2px;
}

.merge-dataset strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
}

.dataset-id {
    font-size: 12px;
    color: #999;
}

.merge-operator {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.join-type {
    background: #0073aa;
    color: #fff;
    padding: 5px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.join-column {
    font-size: 12px;
    color: #666;
    font-weight: 600;
}

.merge-arrow {
    text-align: center;
    font-size: 24px;
    color: #0073aa;
    margin: 5px 0;
}

.close-modal {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 2px;
    cursor: pointer;
    margin-top: 20px;
}

.close-modal:hover {
    background: #005a87;
}

/* ========================================
   Notifications
   ======================================== */

.ql-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
    display: none;
    max-width: 400px;
}

.ql-notification.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #721c24;
}

.ql-notification.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #155724;
}

.ql-notification .message {
    margin-right: 10px;
}

.ql-notification .close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: inherit;
    float: right;
    margin-left: 10px;
}

.ql-notification .close:hover {
    opacity: 0.7;
}

/* ========================================
   Action Buttons
   ======================================== */

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-view-config,
.btn-delete {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 2px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view-config {
    background: #0073aa;
    color: #fff;
}

.btn-view-config:hover {
    background: #005a87;
}

.btn-delete {
    background: #dc3232;
    color: #fff;
}

.btn-delete:hover {
    background: #a02222;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .join-config-inner {
        flex-direction: column;
        align-items: stretch;
    }
    
    .join-column-select,
    .join-type-select {
        width: 100%;
        min-width: auto;
    }
    
    .merge-step {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .merge-operator {
        margin: 10px 0;
    }
}

