/**
 * Advanced Filter Dialog Styles
 */

/* Dialog Overlay */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Dialog Content */
.dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dialog-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dialog-header h2 i {
    color: #007bff;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

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

.dialog-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.dialog-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h3 i {
    color: #007bff;
}

/* Filter Rules */
.filter-rules {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.filter-rule {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.filter-rule select,
.filter-rule input {
    flex: 1;
    min-width: 0;
}

.filter-dimension {
    flex: 2;
}

.filter-operator {
    flex: 0.8;
}

.filter-value {
    flex: 1.5;
}

.btn-remove-filter {
    flex-shrink: 0;
}

/* Form Controls */
.form-select,
.form-input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-select:focus,
.form-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-select {
    background: white;
    cursor: pointer;
}

/* Visualization Toggle */
.viz-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.viz-option {
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.viz-option i {
    font-size: 24px;
    color: #666;
}

.viz-option strong {
    display: block;
    font-size: 14px;
    color: #333;
}

.viz-option small {
    display: block;
    font-size: 12px;
    color: #999;
}

.viz-option:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.viz-option.active {
    border-color: #007bff;
    background: #e7f3ff;
}

.viz-option.active i {
    color: #007bff;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
    justify-content: center;
    margin-bottom: 8px;
}

.btn-icon {
    padding: 8px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #333;
}

.btn-icon i {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 640px) {
    .dialog {
        width: 95%;
        max-height: 95vh;
    }
    
    .filter-rule {
        flex-wrap: wrap;
    }
    
    .filter-rule select,
    .filter-rule input {
        min-width: 120px;
    }
    
    .viz-toggle {
        grid-template-columns: 1fr;
    }
}
